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

Plugin: Reeposition [Was MoveIt]

Development and Programming

maury.mccown's avatar
maury.mccown
87 posts
18 years ago
maury.mccown's avatar maury.mccown

Sweet! That worked. Thanks!

😊

       
reyn's avatar
reyn
17 posts
18 years ago
reyn's avatar reyn

Please see test site where it says “Caption and Title go here” thats what I would like, the main image caption and title in that position. I have tried the reeposition plugin numerous ways and all I get is the plugin code under the main image.

Thank You Frank

       
Mr. Wilson's avatar
Mr. Wilson
131 posts
18 years ago
Mr. Wilson's avatar Mr. Wilson

What have you tried? It’s difficult to say where the problem lies without seeing some samples of what hasn’t worked for you. You might also try setting up a very simple demo demonstrating what you want to do with most of the extraneous stuff stripped out. For example, something like:

<pre><code><body> {exp:reeposition}

{exp:gallery:categories gallery="{gallery_name}”}

stuff stuff stuff

<div id=”leftbottominsert”>{reeposition:put_item}</div> {/exp:gallery:categories}

{exp:gallery:entries gallery="{gallery_name}” dynamic=”on” entry_id=”8”} {reeposition:item}Title: {title}, Caption: {caption}{/reeposition:item} {/exp:gallery:entries}

{/exp:reeposition} </body>

       
reyn's avatar
reyn
17 posts
18 years ago
reyn's avatar reyn

Thank you for your reply Mr Wilson, I have taken a bit of time to try a few things out. The best I can come up with is to get the Title: {title}, Caption: to show in the correct position but without the title changing for each image. What I have done is leave the original title in place under the main image to show what the title should be. Please forget the caption for the moment (they do not yet exist). This original title changes as the images change but the reepositioned one does not. Example site test site . Small explanation the {if segment_3 ==""} section operates only on first load the {if:else} section after first load. Perhaps I am expecting it to do something it was not designed for ie move dynamic tags?

Thank you Frank

<body>
{exp:reeposition}

lots of stuff

<div id="leftbottominsert">{reeposition:put_item}</div>
        {/exp:gallery:categories}

more stuff

<div id="rightcolumn"> 
{if segment_3 ==""}
  {exp:gallery:entries gallery="{gallery_name}" dynamic="on" entry_id="8"}
    <a href="http://{image_url}" rel="lightbox"><span></span> <span>{medium_url}</span></a> 
    
  {title} 
    {reeposition:item}Title: {title}, Caption: {caption}{/reeposition:item}

  {/exp:gallery:entries}

{if:else}

{exp:gallery:entries gallery="{gallery_name}" dynamic="on"}
     <a href="http://{image_url}" rel="lightbox"><span></span> <span>{medium_url}</span></a>

       {title} 
     {reeposition:item}Title: {title}, Caption: {caption}{/reeposition:item}

 {/exp:gallery:entries}
 
 {/if}    

{/exp:reeposition} 
</body>
       
Mr. Wilson's avatar
Mr. Wilson
131 posts
18 years ago
Mr. Wilson's avatar Mr. Wilson

I think I see the problem, Frank. Just to verify that I’m right, could you replace

{if:else}

with

{/if}{if segment_3>""}

I suspect a problem with the advanced conditionals…

       
reyn's avatar
reyn
17 posts
18 years ago
reyn's avatar reyn

That does it, I do not have a clue why but thank you very much. Maybe you could expand my knowledge a bit with a short explanation if it’s not too much trouble.

Frank

       
Mr. Wilson's avatar
Mr. Wilson
131 posts
18 years ago
Mr. Wilson's avatar Mr. Wilson

For some reason*, EE parses advanced conditionals (conditionals that include if:else or if:elseif blocks) differently than simple {if}{/if} blocks. The latter’s contents are parsed if and only if the condition is true; the former’s contents are parsed no matter what, and the decision to display or not display those contents is made very, very late in the template parsing process.

So how did that affect your situation? Basically Reeposition saw TWO {reeposition:item} tags, whereas you assumed it was only seeing one. (One if segment_3==”“, the other if not.) Since Reeposition doesn’t know what to do with multiple {reeposition:item} tags, it just chose one of them to deal with – the first one it came across.

There are two ways to deal with the problem. One is to do what I had you do and use simple conditionals. It makes your template code a little uglier, but it’s more efficient (EE only parses the content of one of the blocks instead of both of them), and it helps out Reeposition in this case. The other option is to use assign each of the reeposition:item tags a unique ID (i.e. {reeposition:item id="hello"} and {reeposition:item id="world"}) … but I don’t think that’s ideal in your situation.

I’m not sure how good of an explanation that was. Let me know if I can clarify.

  • I don’t say “for some reason” to be snarky. I really don’t know. I’ve never looked into the reasons behind the decision to have two different behaviors.
       
reyn's avatar
reyn
17 posts
18 years ago
reyn's avatar reyn

That’s good enough for me, I’ll know to watch out for it in future. Frank

       
Linda A's avatar
Linda A
647 posts
18 years ago
Linda A's avatar Linda A

Mr. Wilson,

I am still running the 1.2beta beta version you put together when you were trying to help me sort out that one really complex index I had. We never managed to get that to work (for some odd reason, the plugin appeared to end up using far more memory than just repeating the weblog entries tag for each part of the display), so I was wondering if you’d suggest I stick with this beta if I plan to use the plugin for something else, or if I should downgrade to the latest proper release?

       
Mr. Wilson's avatar
Mr. Wilson
131 posts
18 years ago
Mr. Wilson's avatar Mr. Wilson

You should be fine sticking with the version you have, Linda. I’m not even sure why I still have the “beta” label attached to 1.2. I probably just forgot to take it off.

       
Linda A's avatar
Linda A
647 posts
18 years ago
Linda A's avatar Linda A

Okay 😊 Just wasn’t sure if it ended up being an experimental ‘side branch’ or if it actually is in line with the regular release.

       
Linda A's avatar
Linda A
647 posts
18 years ago
Linda A's avatar Linda A

Btw, I don’t suppose you have any more idea now why the implementation I tried out never quite worked? 😊

The fact that it does manage to output some of the entries (and with the right formatting and all) makes me think memory issues, but on the other hand, doesn’t a lack of memory in php usually result in a blank page, not a partially rendered page? And it does seem strange if the plugin would take more memory than the 20+ wbelog entries tags I have to use otherwise (and that setup does work).

       
Mr. Wilson's avatar
Mr. Wilson
131 posts
18 years ago
Mr. Wilson's avatar Mr. Wilson

I never did come up with a good explanation for the problems we had with your setup. I don’t remember all the details, but I seem to recall that everything worked just fine … until a certain point. Then it went phlbbbbbp. I never could figure out why that straw kept breaking the camel’s back.

Were you using advanced conditionals ({if:else} and/or {if:elseif} ), by chance?

       
Linda A's avatar
Linda A
647 posts
18 years ago
Linda A's avatar Linda A

Hmm, you know, that might be it. This was the version we ended up with, that seemed like it should work, but that only spit out some of the content:

{exp:reeposition}
{exp:weblog:entries weblog="{current_weblog}" disable="member_data|pagination|trackbacks"}
{if entry_id == "445" || entry_id == "446" || entry_id == "483" || entry_id == "484" || entry_id == "485" || entry_id == "486" || entry_id == "487" || entry_id == "488" || entry_id == "489"}
{reeposition:item id="{entry_id}"}
{if {current_weblog_id}_motto != ""}
<li>{if {current_weblog_id}_book_status == "Dead"}{{/if}<a href="http://www.westeros.org/Citadel/Heraldry/Entry/{entry_id}/" target="Heraldry" onclick="openWindow(this.href,this.target,0,0,1,0,0,750,520,0,0); return false">{title}{if {current_weblog_id}_seat} of {{current_weblog_id}_seat}{/if}</a>{if {current_weblog_id}_book_status == "Dead"}}{/if} - {{current_weblog_id}_motto}</li>
{/if}
{/reeposition:item}
{if:else}
{reeposition:item group="category_{categories}{category_id}{/categories}"}
{if {current_weblog_id}_motto != ""}
<li>{if {current_weblog_id}_book_status == "Dead"}{{/if}<a href="http://www.westeros.org/Citadel/Heraldry/Entry/{entry_id}/" target="Heraldry" onclick="openWindow(this.href,this.target,0,0,1,0,0,750,520,0,0); return false">{title}{if {current_weblog_id}_seat} of {{current_weblog_id}_seat}{/if}</a>{if {current_weblog_id}_book_status == "Dead"}}{/if} - {{current_weblog_id}_motto}</li>
{/if}
{/reeposition:item}
{/if}
{/exp:weblog:entries}

Hmm, can I get away with a regular old conditional in that scenario?

       
Mr. Wilson's avatar
Mr. Wilson
131 posts
18 years ago
Mr. Wilson's avatar Mr. Wilson

Try dumping the advanced conditionals. I hardly ever use them these days because I too often run into problems caused by them being parsed so late in the template parsing process. Regular {if}s make for uglier template code, but they seem sturdier.

       
1 2 3 4 5 Last

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.