1 of 6
1
Plugin: Reeposition [Was MoveIt]
Posted: 15 August 2006 02:17 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  759
Joined  08-16-2003

I don’t know if anybody else will find this useful, but I whipped this up for myself and figured I may as well release it. The MoveIt plugin allows you to move content from Point A to Point B. Sounds pretty boring, doesn’t it? Yeah, well, it is. But it is useful for those situations in which you want to have content from a single {exp:weblog:entries} tag pair appear in two different places, but you don’t want the overhead of calling the weblog module twice. Sample usage:

{exp:moveit}
  {exp
:weblog:entries limit="1" weblog="weblog"}
    
<h1>{title}</h1>
    
{body}
    {moveit
:moveme}{variable_you_want_to_move}{/moveit:moveme}
    {
/exp:weblog:entries}
    
    
... Other stuff in your web page ...
    
    <
div class="movedStuff">
        <
p>
            
{moveit:movetohere}
        
</p>
    </
div>
{/exp:moveit}

You can download it if you think you might find it useful.

Profile
 
 
Posted: 15 August 2006 02:29 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  19268
Joined  06-03-2002

I’m disheartened.  It’s not named Movee?  Or Reeposition?

 Signature 
Profile
MSG
 
 
Posted: 15 August 2006 02:40 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  759
Joined  08-16-2003

Sorry, Derek. I actually thought about Movee, but I was afraid it would mislead people (“What, it’s not a NetFlix plugin?!”). I do like Reeposition, though…

Can I get an Amen on rechristening it Reeposition?

Profile
 
 
Posted: 15 August 2006 02:56 PM   [ Ignore ]   [ # 3 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1181
Joined  03-22-2006

Ameen

How’s Caloree coming along sir?

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 15 August 2006 03:11 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  759
Joined  08-16-2003

How’s Caloree coming along sir?

You would ask that, wouldn’t you? About all I’m willing to say at this point is that it’s moving forward. I don’t plan to be quite as secretive as Rick & Co. in regard to timelines and that sort of thing—in part because I need you folks to kick my butt along a bit—but it’s still too early for any details.

Profile
 
 
Posted: 15 August 2006 03:12 PM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  918
Joined  02-05-2002

Sounds promising Mr. Wilson!

I didn’t test it yet but I can think of quite some situations where this will come in very handy.

Meerci wink

or should it be MercEE?

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 15 August 2006 05:07 PM   [ Ignore ]   [ # 6 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6243
Joined  08-04-2002

Cool!!!
One question, will this work for repositioning the pagination links?
You helped me with that once and this sounds similar but in plugin format.

Profile
 
 
Posted: 15 August 2006 05:39 PM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1403
Joined  02-12-2003

Very cool.  I can think of a few times in the past where something like this would have been handy.  Like PXLated mentioned on the Pagination links.  I can’t remember how many times I’ve wanted those someplace else. 

Jamie

Profile
 
 
Posted: 15 August 2006 05:49 PM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  759
Joined  08-16-2003

Hmm, I hadn’t thought about moving pagination links, but there’s no reason it shouldn’t work. If you get it to work, would you mind posting your code (or pseudo-code) here for others to see?

Profile
 
 
Posted: 15 August 2006 06:02 PM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  759
Joined  08-16-2003

Better yet, I’ll save you the work. Here’s some pseudo code that works with pagination links:

{exp:moveit}
{exp
:weblog:entries weblog="weblog" limit="15" paginate="top"}
<h1>{title}</h1>
{blog_body}
{paginate}
{moveit
:moveme}<p>Page {current_page} of {total_pages} pages {pagination_links}</p>{/moveit:moveme}
{
/paginate}
{
/exp:weblog:entries}
<h2>Move it to here:</h2>
{moveit:movetohere}
{
/exp:moveit}

That’s obviously a very nekkid example, but it works. Just make sure you put the {moveit:moveme} tag pair inside the {paginate} tags, and you’re golden.

Profile
 
 
Posted: 15 August 2006 06:31 PM   [ Ignore ]   [ # 10 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6243
Joined  08-04-2002

Great…I was just going to go search for that thread that helped me…will still try in case it’s useful.

Profile
 
 
Posted: 15 August 2006 06:50 PM   [ Ignore ]   [ # 11 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6243
Joined  08-04-2002

OK, found it… this thread ...Using Javascript to move the pagination…from Derek.
—————
(Beware that I spaced out the “script tags for Forum display)

< script type=“text/javascript” charset=“utf-8”>
function movePagination()
{
document.getElementById(“pagination”)[removed] = document.getElementById(“pagination_hidden”)[removed];
}
</script >

Add an onload event handler to the body tag:
<body onload=“movePagination()”>

Put the pagination links inside a <div id=“pagination_hidden”>, and style that with CSS to be hidden (display: none;).  Put <div id=“pagination”></div> wherever you want the pagination to display in the markup, and everything should work itself out.  I’m (Derek) using innerHTML instead of DOM scripting nodes, because even though it’s not part of the all-wise W3C’s specs, every browser supports it, and it’s about 10 times faster than node-based read/writes.

Profile
 
 
Posted: 15 August 2006 08:24 PM   [ Ignore ]   [ # 12 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  19268
Joined  06-03-2002

Randy, I was really hoping that you would be unable to find that mess.  The JavaScript method, being client side, takes the burden off of the server for doing it.  But geeze, it’s a very very simple string replacement going on in Mr. Wilson’s plugin, and doesn’t require any special markup.

 Signature 
Profile
MSG
 
 
Posted: 15 August 2006 09:41 PM   [ Ignore ]   [ # 13 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6243
Joined  08-04-2002

I agree…The plugin is nifty…And I’d definitely use it.

You’re JS could be handy in some non-weblog situations though I would think.
But, you can delete the post if you really don’t like it ;-)

Profile
 
 
Posted: 28 August 2006 03:54 PM   [ Ignore ]   [ # 14 ]  
Research Assistant
RankRankRank
Total Posts:  301
Joined  06-28-2006

I have a request, I would like to move several variables, ideally, an unlimited number of them.

 Signature 
Profile
 
 
Posted: 28 August 2006 08:50 PM   [ Ignore ]   [ # 15 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  759
Joined  08-16-2003

MoveIt is now dead. In its place rises Reeposition 1.1. The documentation, such as it is, now reads:

This is a pretty simple plugin. Simply wrap the stuff you want to move like so:

{exp:reeposition}
  {exp
:weblog:entries limit="1" weblog="weblog"}
    
<h1>{title}</h1>
    
{body}
    {reeposition
:item}thing_you_want_to_move{/reeposition:item}
    {
/exp:weblog:entries}
    
    
... Other stuff in your web page ...
    
    <
div class="movedStuff">
        <
p>
            
{reeposition:put_item}
        
</p>
    </
div>
{/exp:reeposition}

If you want to move more than one item:

{exp:reeposition}
    {reeposition
:item id="unique_id"}thing_you_want_to_move{/reeposition:item}
    {reeposition
:item id="another_id"}another_thing_you_want_to_move{/reeposition:item}
    
... Other stuff in your web page ...
    
    <
div class="movedStuff">
        <
p>
            
{reeposition:put_item id="another_id"}
        
</p>
        <
p>
            
{reeposition:put_item id="unique_id"}
        
</p>
    </
div>
{/exp:reeposition}
Profile
 
 
Posted: 29 August 2006 06:36 AM   [ Ignore ]   [ # 16 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  759
Joined  08-16-2003

Shoot, there was a typo in the version I just posted that caused some variables not to be replaced. We’ll just call that one a beta version, how ‘bout that? Anyway, it’s fixed now.

Profile
 
 
Posted: 03 September 2006 05:20 PM   [ Ignore ]   [ # 17 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1133
Joined  12-20-2002

Cool idea for a plugin. Really need it for a site I’m currently working on. Thankee, Mr Wilson.

 Signature 

Who ain’t a slave? - Ishmael

Profile
 
 
Posted: 08 September 2006 04:04 PM   [ Ignore ]   [ # 18 ]  
Lab Assistant
RankRank
Total Posts:  275
Joined  01-20-2006

I think something’s wrong here. when ever I move something, the {reeposition:item} tags are still there. fe:

{exp:reeposition}
  {exp
:weblog:entries weblog="reports"}
    
<p>{title}</p>
    
{reeposition:item}slurp{/reeposition:item}
    {
/exp:weblog:entries}

<p>{reeposition:put_item}</p>
{/exp:reeposition}

outputs as:

pagination test
{reeposition:item}slurp{/reeposition:item}

slurp

I’m never gonna get that damned pagination moved now smile

 Signature 

buro taggetig: web design & event photography from Belgium.  |  Follow me on Twitter

Profile
 
 
   
1 of 6
1
 
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 1743, on December 02, 2009 02:47 PM
Total Registered Members: 119463 Total Logged-in Users: 67
Total Topics: 125730 Total Anonymous Users: 32
Total Replies: 661650 Total Guests: 403
Total Posts: 787380    
Members ( View Memberlist )