Search
Other Articles Anywhere questions
Forum

Nested articles not working

Sigrid Gramlinger's Avatar Sigrid Gramlinger
Hi,
I have the following code. It worked in J3 but after the update it does not work anymore. I tried reorder the Sourcerer and AA plugins, but no change
<p>{article}<strong>[title]</strong><br />[adresse]<br />[plz] [ort]{/article}</p>
<h3 class="uk-h4 uk-margin-small">Routenplaner</h3>
<form action="https://maps.google.com/maps" method="get" target="_blank">
<p><label for="adresse">Ihre Startadresse:</label><br /> <input id="adresse" name="saddr" type="text" value="" class="inputbox" placeholder="Adresse, PLZ Ort" /><br />{source}&lt;input name="daddr" type="hidden" value="{article}[adresse] [plz] [ort]{/article}" /&gt;{/source}</p>
<p><button type="submit" class="btn">Route aufrufen</button></p>
</form>

The hidden input does not work, shows on the website:
<input name="daddr" type="hidden" value="{article}[adresse] [plz] [ort]{/article}">

I think I remember the with nested articles I need to rearrange something, but I cannot remember/find anything.
Thanks for any hint.
Best regards
Sigrid
Sigrid Gramlinger's Avatar Sigrid Gramlinger
Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
Try placing the article tags outside the form:
<p>{article}</p>
<p><strong>[title]</strong><br />[adresse]<br />[plz] [ort]</p>
<h3 class="uk-h4 uk-margin-small">Routenplaner</h3>
<form action="https://maps.google.com/maps" method="get" target="_blank">
<p><label for="adresse">Ihre Startadresse:</label><br /> <input id="adresse" name="saddr" type="text" value="" class="inputbox" placeholder="Adresse, PLZ Ort" /><br />{source}&lt;input name="daddr" type="hidden" value="[adresse] [plz] [ort]" /&gt;{/source}</p>
<p><button type="submit" class="btn">Route aufrufen</button></p>
</form>
</p>{/article}</p>
Also, by default, fields will use the field layout for the output. So - as you can see in the output html - [ort] will output:
<span class="field-value ">Deutschlandsberg</span>
You probably want to only output the value part in the form field value. So use:
value="[adresse:text] [plz:text] [ort:text]"
See: docs4.regularlabs.com/articlesanywhere/d...lain-text-raw-values
Please post a rating at the Joomla! Extensions Directory
Sigrid Gramlinger's Avatar Sigrid Gramlinger
Now it works. I think the value part ":text" did the trick. And I moved the {article} around the whole html part. Then I don't even need the {source}! 🙂
{article}<p><strong>[title]</strong><br />[adresse]<br />[plz] [ort]</p>
<h3 class="uk-h4 uk-margin-small">Routenplaner</h3>
<form action="https://maps.google.com/maps" method="get" target="_blank">
<p><label for="adresse">Ihre Startadresse:</label><br /> <input id="adresse" name="saddr" type="text" value="" class="inputbox" placeholder="Adresse, PLZ Ort" /><br /><input name="daddr" type="hidden" value="[adresse:text] [plz:text] [ort:text]"></p>
<p><button type="submit" class="btn">Route aufrufen</button></p>
</form>{/article}

Thank you!
Problem solved
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription