3 of 6
3
Plugin: Reeposition [Was MoveIt]
Posted: 22 January 2007 03:46 PM   [ Ignore ]   [ # 37 ]  
Grad Student
Rank
Total Posts:  58
Joined  05-12-2006

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

Profile
 
 
Posted: 29 January 2007 08:33 AM   [ Ignore ]   [ # 38 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1520
Joined  05-15-2004

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?

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 29 January 2007 08:41 AM   [ Ignore ]   [ # 39 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  752
Joined  08-16-2003

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.

 Signature 

Pst… have you taken a look at Weever yet?

Profile
 
 
Posted: 29 January 2007 08:49 AM   [ Ignore ]   [ # 40 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1520
Joined  05-15-2004

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

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 29 January 2007 09:16 AM   [ Ignore ]   [ # 41 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1520
Joined  05-15-2004

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

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).

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 29 January 2007 09:47 AM   [ Ignore ]   [ # 42 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  752
Joined  08-16-2003

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?

 Signature 

Pst… have you taken a look at Weever yet?

Profile
 
 
Posted: 29 January 2007 09:59 AM   [ Ignore ]   [ # 43 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1520
Joined  05-15-2004

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?

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 29 January 2007 10:15 AM   [ Ignore ]   [ # 44 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  752
Joined  08-16-2003

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.

 Signature 

Pst… have you taken a look at Weever yet?

Profile
 
 
Posted: 29 January 2007 10:26 AM   [ Ignore ]   [ # 45 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1520
Joined  05-15-2004

Not sure if I did this right, but I tried to switch to just regular conditionals and then I am definitely running into memory issues as I get a blank page:

{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 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 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}

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 29 January 2007 11:04 AM   [ Ignore ]   [ # 46 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  752
Joined  08-16-2003

Not sure how much of an effect it’s having on the memory of the operation, but in your second big {if…} block, you want &&‘s instead of ||‘s.

 Signature 

Pst… have you taken a look at Weever yet?

Profile
 
 
Posted: 29 January 2007 11:19 AM   [ Ignore ]   [ # 47 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1520
Joined  05-15-2004

Oh, okay. Didn’t make any difference for the memory issue, though.

Very odd, on the whole. But maybe I’ll have more luck with the other section I was going to try the plugin for. smile

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 29 January 2007 01:36 PM   [ Ignore ]   [ # 48 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1520
Joined  05-15-2004

Speaking of that other section, I am now trying to sort out whether Reeposition can be used for it or should be ruled out as a possible solution.

The index on this page is the goal I am working towards: http://www.westeros.org/Citadel/Concordance/

Lets say that each link in that index is made into an entry, named as the links are currently named.

Do you think Reeposition could help me create an index of these entries that is formatted just as the index currently is formatted? Since its an existing static section that I am trying to move into EE, its important for me to stay as close to the old layout as possible.

I have been trying all day to wrap my head around how one could do this, but I don’t think I am too much closer to a solution. It would be easy enough to label each ‘level’ of entries using categories or a custom status for each, but actually producing a nested index like that without having to manually lay it out seems like it would take some pretty convoluted conditionals, and that might be an issue with Reeposition given the advanced conditionals issues.

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 09 March 2007 04:20 AM   [ Ignore ]   [ # 49 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  02-05-2002

Hi all, Mr. Wilson,

I am trying to move multiple items using your wonderful Reeposition plugin, but I can’t get it to do what I want this time.
The code I have right now does reposition the code, but unfortunately it shows the same (first) entry twice.

Could you tell me if this code should be working, or how I can get it to work… or is this not possible?

{exp:reeposition}


{
!-- //weblog tag --}
{exp:weblog:entries weblog="home" orderby="date" sort="asc" limit="2"}

{if count
== 1}
{reeposition
:item id="unique_id"}
<h1>{title}</h1>
{body}
{
/reeposition:item}
{
/if}

{if count
== 2}
{reeposition
:item id="another_id"}
<h3>{title}</h3>
{summary}
{
/reeposition:item}
{
/if}

{
/exp:weblog:entries}
{
!-- //end weblog tag --}


{!-- //put_item(s) --}
<div style="background:red">
    
{reeposition:put_item id="unique_id"}
</div>

<
div style="background:green">
    
{reeposition:put_item id="another_id"}
</div>
{!-- //end put_item(s) --}


{/exp:reeposition}

Cheers

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 09 March 2007 09:02 AM   [ Ignore ]   [ # 50 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  752
Joined  08-16-2003

Okey dokey, I took a look at this and I think I see what’s happening. Fortunately, I also have a solution. I’ll start with the solution. Change these lines:

{reeposition:item id="unique_id"}
{reeposition
:item id="another_id"}
{reeposition
:put_item id="unique_id"}
{reeposition
:put_item id="another_id"}

to these:

{reeposition:item id="unique_id_{count}"}
{reeposition
:item id="another_id_{count}"}
{reeposition
:put_item id="unique_id_1"}
{reeposition
:put_item id="another_id_2"}

As for an explanation, without looking into it too deeply, it looks like you’re hitting some sort of parsing order problem. At the time Reeposition runs, it is seeing the contents of both “if” blocks for both entries. That means two things. First, it means that Reeposition ends up trying to place four (2x2) different items; and second, it means that both of the put_item variables get replaced by the first entry, leaving nothing else to replace after that. (Did that make any sense?)

I will need to look deeper to determine if there’s something I can do to Reeposition to help the situation, but the only solution that comes to mind would cause problems in certain usage scenarios, so it’s out.

 Signature 

Pst… have you taken a look at Weever yet?

Profile
 
 
Posted: 09 March 2007 09:17 AM   [ Ignore ]   [ # 51 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  02-05-2002

Thank you.

This is perfect for positioning multiple ‘blocks’ with different styles on a homepage for example.

Because the ID’s need to be unique even without the added number, I’m now using this code:

{reeposition:item id="id_1_{count}"}
{reeposition
:item id="id_2_{count}"}
{reeposition
:put_item id="id_1_1"}
{reeposition
:put_item id="id_2_2"}

It looks a bit odd with the double numbers but this doesn’t work:

{reeposition:item id="id_{count}"}
{reeposition
:item id="id_{count}"}
{reeposition
:put_item id="id_1"}
{reeposition
:put_item id="id_2"}

I figured it would be a parsing issue.
It would be great if there was a slightly more foolproof method, but this will do for now grin

Thanks again!

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 01 June 2007 04:50 AM   [ Ignore ]   [ # 52 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  599
Joined  12-10-2006

Any idea why this is not working? It does not seem to move the items, but prints out the tags (I get {reeposition:put_item id=“catid”} and {reeposition:put_item id=“catid”} tags displayed in the debugging).

{exp:reeposition}
{
!-- Contents page of a given Target issue --}
{if segment_3
!= "" AND segment_3 != "archives" AND segment_4 == NULL}
<div id="coverContainer">
<
h1>Target Magazine</h1>
{exp:query sql="SELECT cat_id FROM exp_categories WHERE cat_name = '{segment_3}'"}
{exp
:weblog:entries weblog="target_cover" limit="1" disable="member_data|trackbacks" category="{cat_id}"}
<div id="targetIssueNavContainer">
    <
div id="targetIssueNav">
    <
p>
        
Issue {categories}{exp:replace find=",SPACE" replace="SPACE/SPACE" multiple="yes"}{category_description}{/exp:replace}{/categories} / <span id="issueName"></td>
    </
tr>
</
table>
{/exp:weblog:entries}
</div>
{/if}
{
!-- Individual Target articles by issue --}
{if segment_4
!= ""}
{exp
:query sql="SELECT cat_id FROM exp_categories WHERE cat_name = '{segment_3}'"}
    {exp
:weblog:entries weblog="target" orderby="target_section" sort="desc" paginate="top" disable="member_data|trackbacks" category="{cat_id}"}
        {reeposition
:item id="articlepagination"}{paginate}{if previous_page}<a href="{auto_path}">Previous Page</a> &nbsp;{/if}{if next_page}<a href="{auto_path}">Next Page</a>{/if}{/paginate}{/reeposition:item}
    {
/exp:weblog:entries}
{
/exp:query}
{exp
:weblog:entries weblog="target" cache="yes" refresh="240" disable="member_data|trackbacks" url_title="{segment_4}"}
<div id="targetIssueNavContainer">
    <
div id="targetIssueNav">
    <
p>
        
Issue {categories}{exp:replace find=",SPACE" replace="SPACE/SPACE" multiple="yes"}{category_description}{/exp:replace}{/categories} / <span id="issueName"><a href="/resources/target/{segment_3}">{title}</a></span>
    </
p>
    </
div>
</
div>
{reeposition:put_item id="articlepagination"}
<p>
    
{title}
</p>
<
p>
    
{target_articletext}
</p>
{/exp:weblog:entries}
{
/if}
{
!-- Target archives listing --}
{if segment_3
== "archives"}
<h1>Target Magazine</h1>
<
div id="targetContents">
    
{exp:weblog:entries weblog="target_cover" orderby="url_title" sort="desc" disable="member_data|trackbacks"}
    
<p>
        
{categories}<a href="/resources/target/{category_name}">{category_name}{/categories}</a>
    </
p>
    
{/exp:weblog:entries}
</div>
{/if}
{
/exp:reeposition}

Profile
 
 
Posted: 01 June 2007 05:16 AM   [ Ignore ]   [ # 53 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  503
Joined  07-02-2005
Adam George - 01 June 2007 04:50 AM

Any idea why this is not working? It does not seem to move the items, but prints out the tags (I get {reeposition:put_item id=“catid”} and {reeposition:put_item id=“catid”} tags displayed in the debugging).

Try changing it to this:

{paginate}{reeposition:item id="articlepagination"}{if previous_page}<a href="{auto_path}">Previous Page</a> &nbsp;{/if}{if next_page}<a href="{auto_path}">Next Page</a>{/if}{/reeposition:item}{/paginate}

Notice that I put the reeposition tag inside the paginate tag instead of out.  The paginate tag simply defines how it will look, not where it will go; hence, trying to reposition this is an exercise in futility.  However, if you reposition its contents, it should work.

EDIT:  I assume this is the snippet of code you were talking about?

 Signature 

– Joseph Bermann
Admin, Deep Thought
EE 1.6.4, Forum 2.0.0

Profile
 
 
Posted: 01 June 2007 06:49 AM   [ Ignore ]   [ # 54 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  599
Joined  12-10-2006

Thanks Arden!

That will hopefully solve one of my problems!

I was actually talking about something else, which in my haste, I hadn’t pasted in:

{!-- Contents page of latest Target issue shown if no issue selected --}
{if segment_3
== NULL}
{exp
:weblog:entries weblog="target_cover" limit="1" orderby="url_title" sort="desc" disable="member_data|trackbacks"}
{categories}{reeposition
:item id="catid"}{category_id}{/reeposition:item}{/categories}
<h1>Target Magazine</h1>
<
div id="coverContainer">
...
</
div>
{/exp:weblog:entries}
<div id="targetContents">
<
h2>In this issue:</h2>
{exp:weblog:entries weblog="target" disable="member_data|trackbacks" category="{reeposition:put_item id="catid"}"}
<table>
    <
tr>
        <
td class="targetSection">{target_section}</td><td class="targetArticleTitle"><a href="{url_title_path=resources/target/}">{title}</a></td>
    </
tr>
</
table>
{/exp:weblog:entries}
</div>
{/if}

What I’m trying to do is pull up the latest entry according to a sort oder, find the category that entry belongs to, then move that category ID down to the last exp:weblog:entries tag.

Profile
 
 
   
3 of 6
3
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66469 Total Logged-in Users: 40
Total Topics: 84869 Total Anonymous Users: 19
Total Replies: 455370 Total Guests: 221
Total Posts: 540239    
Members ( View Memberlist )