Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
txp:yield as value in txp:section tag?
Hi!
When using txp:yield as a value the tag doesent seem to work as expected. Here is an example:
<txp:output_form form="section">home</txp:output_form>
And in the section form:
<txp:section name='<txp:yield />' title="1" link="1" />
Offline
#2 2011-08-16 16:38:37
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: txp:yield as value in txp:section tag?
Have you tried to not use “section” as a form name, also avoiding one of the other reserved terms? (look for reserved on each page)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: txp:yield as value in txp:section tag?
What does it output and what is expected? The code should work. Do you have section named home? Textpattern’s home page section is called default.
uli wrote:
Have you tried to not use “section” as a form name, also avoiding one of the other reserved terms? (look for reserved on each page)
First one is meant for custom fields and other for sections. Form names can be used freely, and there are no list of reserved terms, apart from the default forms that are — mandatory. Pretty much anything goes.
Last edited by Gocom (2011-08-16 16:48:44)
Offline
Re: txp:yield as value in txp:section tag?
Thanks for the fast replies!
@Uli:
Section was just a (bad) example. I’m using other section names.
@Gocom:
The code doesn’t output anything. I thought it would output a linked section title named home.
I’ve tried different existing section names, and no one seems to work.
Offline
Offline
Re: txp:yield as value in txp:section tag?
<!— txp tag trace:
[SQL (0,00380611419678): select name, data from txp_lang where lang=‘sv-se’ AND ( event=‘public’ OR event=‘common’)]
[SQL (0,164562940598): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0,000262975692749): select name,code,version from txp_plugin where status = 1 AND name=‘mem_form’]
[SQL (0,000148057937622): select name,code,version from txp_plugin where status = 1 AND name=‘glz_custom_fields’]
[SQL (0,000142097473145): select version from txp_plugin where status = 1 AND name=‘sed_section_fields’]
[SQL (4,10079956055E-5): select version from txp_plugin where status = 1 AND name=‘cnk_section_tree’]
[SQL (0,000406980514526): select name,code,version from txp_plugin where status = 1 AND name=‘soo_txp_obj’]
[SQL (0,00117993354797): select name from txp_lang where lang=‘sv-se’ limit 1]
[SQL (0,000446796417236): select name, data from txp_lang where lang=‘sv-se’ AND event=‘soo_page_numbers’]
[SQL (0,000203847885132): select name, val from txp_prefs where prefs_id=1 AND user_name=’‘]
[SQL (0,000844955444336): select name,code,version from txp_plugin where status = 1 AND name=‘smd_lib’]
[SQL (0,000149965286255): select name,code,version from txp_plugin where status = 1 AND name=‘mem_admin_parse’]
[SQL (6,103515625E-5): select name,code,version from txp_plugin where status = 1 AND name=‘ign_password_protect’]
[SQL (5,10215759277E-5): select name,code,version from txp_plugin where status = 1 AND name=‘mem_self_register’]
[SQL (0,000714063644409): select privs from txp_users where name=’‘]
[SQL (8,48770141602E-5): select * from tru_tags_prefs where 1]
[SQL (0,0272159576416): select * from smd_macro where 1=1]
[SQL (0,0415749549866): select name from txp_section where `name` like ‘test’ limit 1]
[SQL (0,000633955001831): select page, css from txp_section where name = ‘test’ limit 1]
[SQL (0,0661268234253): select host from txp_log where ip=‘217.208.59.16’ limit 1]
[SQL (0,20779800415): insert into txp_log set `time`=now(),page=’/klm/test’,ip=‘217.208.59.16’,host=‘217-208-59-16-no122.tbcn.telia.com’,refer=’‘,status=‘200’,method=‘GET’]
[SQL (0,0876038074493): select user_html from txp_page where name=‘test’]
[Sida: test]
<txp:output_form form=“mega_menu” />
[SQL (0,00037407875061): select Form from txp_form where name=‘mega_menu’]
[Siddel: mega_menu]
<txp:output_form form=“mega_section”>
[SQL (0,000121116638184): select Form from txp_form where name=‘mega_section’]
[Siddel: mega_section]
<txp:section name=’<txp:yield />’ title=“1” link=“1” />
[attribute ‘name’]
<txp:yield />
[/attribute]
[SQL (0,000128030776978): select title from txp_section where name=‘blogg\r\n’]
</txp:output_form>
<txp:hide>
</txp:hide>
[ ~~~ secondpass ~~~ ]
—>
Offline
Re: txp:yield as value in txp:section tag?
Looks like your yield data ends with<return><newline>. Are you sure you are doing this:
<txp:output_form form="section">home</txp:output_form>
and not this:
<txp:output_form form="section">
home
</txp:output_form>
Offline
Re: txp:yield as value in txp:section tag?
[SQL (0,000128030776978): select title from txp_section where name='blogg\r\n']
If the section you were trying to include was “blogg”, it looks like it worked but somehow there’s a line break – \r\n
– in the SQL query. Could that be the reason why it is returning nothing?
have you used it exactly as you wrote above without any blank lines in there, e.g.:
<txp:output_form form="mega_section">blogg</txp:output_form>
EDIT: Sam was faster :-)
Last edited by jakob (2011-08-16 19:45:08)
TXP Builders – finely-crafted code, design and txp
Offline
Re: txp:yield as value in txp:section tag?
That’s it! Thanks for helping out guys.
Offline