You are not logged in.
colak wrote:
Vote for core:)
+1 :)
<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields
Offline
One of the basics of my idea was to leave no traces in the database.
Er, are forms not in the database now?
I guess you mean no new table, right?
Last edited by Mary (2008-05-23 08:12:29)
My email address has changed recently. If you need to contact me, use the forum contact form.
Offline
Mary wrote:
I guess you mean no new table, right?
To rephrase: nothing which would require a new UI or longish explanations of how to CRUD these variables. I think that forms, tags and pages are broadly understood and readily available to a designer. Otherwise it would probably fit into (a second instance of) prefs. I’d prefer a method of creation which is for instance deployable with mcw_templates.
Last edited by wet (2008-05-23 09:09:27)
Try wet_quicklink | Me | @rwetzlmayr | +Robert Wetzlmayr | Repos
Offline
Couldn’t this be done by giving a name attribute to a well introduced tag, <txp:text />?
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Interesting to read where this has grown in the meantime!
Will it be also possible to use variable names already created by txp code/plugins? If so:
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Uli, insert <pre><txp:php>print_r($GLOBALS);</txp:php></pre> somewhere in your template.
Offline
Commited as change set 2899.
uli wrote:
How can I display the currently used ones and their contents?
<txp:variable name="humtata" value='<txp:php>global $site_slogan; echo $site_slogan;</txp:php>' />;
Last edited by wet (2008-05-28 04:39:34)
Try wet_quicklink | Me | @rwetzlmayr | +Robert Wetzlmayr | Repos
Offline
wet, your fingers are inspired…
A sci-fi feature request:
Imagine…
Imagine a future functionality (a plug-in?) on the admin side… that looks (parses) for declared <txp:variable name="varname" value="" /> on top of templates and then, somewhere in the admin interface (probably in a tab we want to make accessible for our clients… or not), it renders (automagically and on-the-fly) little form, made from a label (txp:variable name value) and a text input field (prefilled with txp:variable value value) for each txp:variable for every variable in every template.
Then, using that form, we/our-clients can rewrite the value of any variable on any template (that means, we set a new value, hit “Submit”, then TXP magic dust goes to the template, looks for the corresponding txp:variable name="name" tag and rewrites it with the new value for value.
Some ideas about this:
Example:
<txp:variable name="closed_for_vacation" value="no" />
<txp:variable name="display_banner" value="yes" />
// ...
// ...
<txp:if_variable name="closed_for_vacation" value="yes">
We are closed for vacations. Come back later.
<txp:else />
It's open. We are here.
</txp:if_variable>
//...
//...
<txp:if_variable name="display_banner" value="yes">
Super mega banner.
<txp:else />
No banner here.
</txp:if_variable>
Again, for those two declared variables, there is a magic parser that looks for txp:variable and creates on the fly the two label/text input fields for changing the current value to a new one.
Client changes the value, hits submit, the value is replaced on the tag (on the template).
Then, clients will be able to control the chunks of conditional code, in other words, of the output, in a new way.
Am… I… missing… something?
Last edited by maniqui (2008-05-28 05:43:16)
Offline
no need for storing the variable name on the database
Well, the variables are inherently stored in the database (via forms and pages). They just lack defined records.
I think it would be easier to modify variables from an admin form if they were stored in a txp_variables table. Users can define form-modifiable ones through the admin, as in your example, or they can use them in templates like the current implementation (“inline”). The inline ones won’t be modifiable via the admin.
So closed_for_vacation would be defined and edited in an admin form, but <txp:variable name="tmp" val="foo"/> in a page wouldn’t be modifiable through the admin.
Last edited by jm (2008-05-28 05:59:11)
Offline