Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[resolved] Short code worked... then didn't
I have this short code setup in a form:
<txp:hide> ASIDE PULLQUOTES SHORT-TAG
Use this in an article as:
<txp::aside />
<txp:output_form yield form="aside" />
Attributes are:
id="" (the ID of the link in Links panel; applied <txp:linklist>)
class="" (applied to <aside> element)
Either 'left' or 'right' (to float left or right).
Plus one of these: 'micropost', 'pullquote', 'profile' for specific presentation.
width="" (an expected value/units like 25%, 150px, etc; applied on <aside>)
name="" (name or nick of person quoted; applied to <p> element)
</txp:hide>
<aside<txp:if_yield name="class"> class="<txp:yield name="class" />"</txp:if_yield><txp:if_yield name="width"> style="width:<txp:yield name="width" />;"</txp:if_yield>>
<txp:linklist id='<txp:yield name="id" />'>
<q><txp:link_description escape="tidy,textile,ltrim" /></q>
<p class="sig"><txp:if_yield name="name"><txp:yield name="name" /><txp:else /></txp:if_yield><span class="sourcelink"><a href="<txp:link_url />"><txp:link /></a></span></p>
</txp:linklist>
</aside>
I use a short tag with it like this, for example:
<txp::aside id="12" class="right micropost" width="20%" name="Nick" />
But nothing outputs. Anyone see the problem?
I wrote this example a while back. That used to work for me. But I can’t get that to work either, as written.
By comparison, this figure example works fine, and I’ve even edited that one to use the width
attribute as indicated above. No problem.
I’m not sure what’s up with the asides, though.
Offline
Re: [resolved] Short code worked... then didn't
<txp::aside id="12" class="right micropost" width="20%" name="Nick" />
Where do you insert the id
from <txp:linklist id='<txp:yield name="id" />'>
?
Maybe the above could be changed to
<txp::aside id="12" class="right micropost" width="20%" name="Nick" id="xx" />
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [resolved] Short code worked... then didn't
colak wrote #319723:
Where do you insert the
id
from<txp:linklist id='<txp:yield name="id" />'>
?
I don’t quite follow what you mean. I thought the ID value, 12
in this example, would be pulled from the tag’s attribute and plugged into the form where defined.
Anyway, I just tried putting id=""
at the end of the attributes line up. Still nothing.
I’m wondering if there’s interference with my choice of form name or attribute terms against core terms, or something. But I’ve tried changing everything around as a test. Nothing grabs.
I don’t get why it worked and then just stopped working when I edited the form; especially if there’s nothing wrong with the form structure.
Offline
Re: [resolved] Short code worked... then didn't
whoops just noticed you had the id="12
anyway. I take it that you have more than one id normally, such as id="12,14,18"
.
Re, your issue. I cannot really see what is wrong with the code. Did you consider turning your site on debug in order to see if the tag trace reveals something?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [resolved] Short code worked... then didn't
You must close <txp:linklist>
inside <txp:hide>...</txp:hide>
block. Even if it is not executed nor displayed, the parser analyses “hidden” content and gets confused by unclosed blocks. Enable debug mode to see what happens. We don’t want to introduce an exception for <txp:hide />
(or any other) tag here.
Offline
Re: [resolved] Short code worked... then didn't
etc wrote #319727:
You must close
<txp:linklist>
inside<txp:hide>...</txp:hide>
block.
THANK YOU! 🙏
That was it. I didn’t mean to write it like that but I couldn’t spot it afterward. And I didn’t know that about the parser anyway. Good to know.
Offline