We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

LG Replace - limit issue

Development and Programming

julie p's avatar
julie p
282 posts
16 years ago
julie p's avatar julie p

Hey all -

I’ve just “inherited” a new EE system with a new client. The former developer is using LG Replace to replace up to three images in any given post.

This code isn’t working for me, because I removed a limit=”1”:

{exp:lg_replace:haystack needles="photo1|photo2|photo3"} 

{exp:weblog:entries weblog="{section}"}
<div class="article">
<h2>{title}</h2>
{body}
</div>

{exp:lg_replace:replacement needle="photo1"}

<span class="captionedimg">
{img1} image 1
{caption1} caption 1
</span>

{/exp:lg_replace:replacement}

{exp:lg_replace:replacement needle="photo1"}

<span class="captionedimg">
{img2}
{caption2}
</span>

{/exp:lg_replace:replacement}

{exp:lg_replace:replacement needle="photo3"}

    <span class="captionedimg">
    {img3}
    {caption3}
    </span>

{/exp:lg_replace:replacement}
{/exp:weblog:entries}
{/exp:lg_replace:haystack}

I have put in some dummy content next to the {img1} and {caption1} tags to test their efficacy. The words print out, but not the value in those fields. This code does work, however, if I limit the query to “1”.

Ideas?

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.