Jump to content


Photo
- - - - -

Site Content Variable


  • Please log in to reply
6 replies to this topic

#1 Dimmy

Dimmy

    Etomite Forum Fan

  • Member
  • Pip
  • 109 posts

Posted 24 September 2004 - 01:34 PM

Would it be posible to get some site content variable a bit like the [(sitename)] tag that works tru the whole site. I added a extra variable to the settings in a way that I can have like the adres or a logo ore a Company Slogon etc set for the whole site. this way it is posible to use the same template for more sites witout editing the header for the logo or the footer for the adres etc. ore using multiple templates without editing the template to add these variables.

I know that I can add some more fields 2 the settings by modding etomite but I do not want the "client"to be able to change the settings but it would be nice if he could change his adres or logo.

I hope I am clear enough my english is not that good sorry.

so to summe it up:

logo, adres, slogon, etc accesible by a tagg like [(sitename)]
editable by usen even when settings restrictions are on
picture upload would be nice or at least to select a picture and whit the <img src=... tag automaticly added (when no picture no red cross)

thats about it

Thank you for reading

Greets Dimmy

#2 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 24 September 2004 - 03:07 PM

You can accomplish this by assigning a session variable similar to $_SESSION['myvariable'] = $myvariable; and then reading the variable back into another snippet using $myvariable = $_SESSION['myvariable'];... This method doesn't require adding a fields to one of the database tables... You could create a snippet which does these assignments and your client could simply change the variable contents... This would be the quickest and easiest solution...

You could also just add the additional settings as records in the etomite_system_settings table and access them in the fashion you described, but this would entail your creating a form for managing these additonal settings records, or using phpMyAdmin to manage the records... Note that you would not be required to add additional fields, just records... In any event, this would entail some work on your part unless you can bribe a member to write you a custom module for managing these records...

Let me know your thoughts on each idea... B)

#3 Dimmy

Dimmy

    Etomite Forum Fan

  • Member
  • Pip
  • 109 posts

Posted 03 October 2004 - 09:36 PM

You can accomplish this by assigning a session variable similar to $_SESSION['myvariable'] = $myvariable; and then reading the variable back into another snippet using $myvariable = $_SESSION['myvariable'];... This method doesn't require adding a fields to one of the database tables... You could create a snippet which does these assignments and your client could simply change the variable contents... This would be the quickest and easiest solution...

You could also just add the additional settings as records in the etomite_system_settings table and access them in the fashion you described, but this would entail your creating a form for managing these additonal settings records, or using phpMyAdmin to manage the records... Note that you would not be required to add additional fields, just records... In any event, this would entail some work on your part unless you can bribe a member to write you a custom module for managing these records...

Let me know your thoughts on each idea...  B)



but this variable is it not set only for the one page you work on?
or do i miss the point?
Is it that I could use a variable from another document in more than only that document?


I could add menu items in the manager and get me a sort of clone of the settings pages but than limitet to the 3 site contents i want? and in a way that it is not blokked when making a user that is not able to change etomite settings?

the first one would be easy but not as client friendly as the second option.
my php is not that advanced that i can write this snipped but i could change code a bit i think.

the one thing that is a schame when modding the etomite core is that when abn update is done i need to make all these changes again
did you already made a docvar for 0.6 final?

Thank you so much for helping out here at the Etomite forums.

I have lots of ideas but that would be addons or hacks mybe.

like a small setup for your user where he can set a template and fill in his site name upload his logo and fill in his adres etc. then he comes into his manager (no admin rights just client rights)

but that would be a big addon i think

man I wish that I could programm PHP like you do.
I just started 3 weeks ago have a lot to lern
before I programmed a little turbobasic hehe like 10 years ago
this is so differnt but understandible like perl an java

Greets Dimmy

#4 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 04 October 2004 - 01:11 AM

In regard to modifying the Etomite core, I have no intentions of diving into those waters for several reasons... The main reason being that I don't want to have to be concerned with re-tweaking future releases... As soon as new releases are available I need to be able to get them up and running as quickly and effortlessly as possible... If I was to run an overly modified version, this would not be a realistic expectation... Additionally, I can be of more help by working on problems and snippets than I can in finding ways to tweak an existing release... Spending my time supporting core modifications would detract me from my efforts of promoting Etomite as a viable development environment in its current state... For these reasons, along with personal time contraints, I'll leave all core programming up to Alex... Nobody knows best which direction this project should move in than him, anyway...

As for what you are referring to as Plug-In's, maybe a slight mind-shift on your part would help matters along in a better fashion... Rather than thinking that you need to modify the core of Etomite to do what you want, why not consider your modifications from the website perspective rather than from the Etomite Manager perspective... You can just as easily create small modules, written as snippets, which would enable a client to maintain portions of their website without ever needing to access Etomite Manager directly... One of the biggest benefits of this concept is that your snippet modules would simply migrate into any new releases, making upgrades much smoother... It would also allow for more stringent control over what your client has access to as far as content is concerned... Such a method would entail some intermediate programming skills, however, and may prove beyond you immediate capabilities... I have merely tossed out the idea as food for thought...

Now, onto the idea of session variables and site content issues... Any session variable, once created and assigned a value, can be accessed from any piece of PHP code anywhere within the overall web application... Just think of your Etomized website as being one big program which gets continuously rewritten and processed with each and every page rendering, or click of the mouse... If you were to use session variables, these variables could be assigned and reassigned as needed by multiple pieces of snippet code... These would be site-wide variables...

If you want to have additional data fields for each piece of site content, then you would be looking at either adding fields to the site_content table itself, or possibly using the templating concept discussed elsewhere within the forums... By rereading your original message, this doesn't sound like what you are looking for, however...

Here is how I accomplish essentially what you have described... I have a customer site which uses a specific template for layout... Within this template I make calls to Chunks which hold the PageHeader, PageSlogan, and PageFooter... To change the sites slogan all that is required is to edit the PageSlogan Chunk... If my customer didn't want to be bothered with Etomite Manager, or calling me to make the required change, I could create a very compact PHP script, in the form of a Snippet, which would allow them to make this change using a simple web form... Making this form would be a matter of modifying an existing form - possibly my GuestBook for Snippet, or one written from scratch... This was the reasoning behind my creating the MemberMakeMenu Snippet, as it would allow my customer to login and make several small changes without the need for them to be exposed to the Etomite Manager...

Okay, this message is getting long and drawn out so I'll warp it up for now... I hope I've answered some of your questions, and I'm sure that I've nurtured a few more... In short, don't spend a lot of time pondering the idea of hacking the Etomite core... There are plenty of other options at your disposal which would be more worthy of your time and effort, not to mention more likely to get any needed programming support...

:eto: Runs off to try a few ideas inspired by writing this diatribe... :rolleyes:

#5 zatoichi

zatoichi

    Etomite Forum Newbie

  • Member
  • 6 posts

Posted 17 August 2005 - 06:24 PM

This is precisely what I would like to do. I am experimenting with it right now. I am using the etomite->dbquery() to access two extra tables I added to the database for restaurant listings. But was trying to figure out how to pass an addition variable into a page to display a single category listing and then a single restaurant listing. I think this is my answer.

Briefly my thought was to list all my categories on one page:
http://www.lunchdowntown.com/menu/index.php?id=32

with links built like this for each category:

http://www.lunchdowntown.com/menu/index.php?id=33&cat=9

on page 33 I need the variable cat=9 to be passed to another dbquery() to list all of one category, which would then have links with individual restaurant id's to be passed to another page.

I can use the session variable to do this? And I am assuming I assign it within my first snippet? By the time you answer this, if you do, hopefully I'll know the answer to that through trial and error. But maybe this will help someone else?


By the way etomite is brilliant as far as I am concerned. It sets up in two minutes and seems to be pretty well optimized as it runs fast on every host I've tried it on.

#6 zatoichi

zatoichi

    Etomite Forum Newbie

  • Member
  • 6 posts

Posted 21 August 2005 - 05:18 PM

Actually, after experimenting awhile and looking at other snippets I figured out that I could use $_POST[] and $_GET[] as long as it is returning to the same page. What I wanted to do works fine now.

Etomite has turned out to be the perfect framework for creating websites for me. It is also helping me learn php faster than I had thought possible. Kudos to the development team and those continueing the work!

#7 Guest_Xela Rettub_*

Guest_Xela Rettub_*
  • Guests

Posted 07 September 2005 - 12:04 PM

The best way for currently storing this kind of info is to use Chunks.

{{SiteSlogan}} etc.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users