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

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

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">
        
            {moveit:movetohere}
        
    </div>
{/exp:moveit}

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

       
Derek Jones's avatar
Derek Jones
7,561 posts
18 years ago
Derek Jones's avatar Derek Jones

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

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

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?

       
Daniel Walton's avatar
Daniel Walton
553 posts
18 years ago
Daniel Walton's avatar Daniel Walton

Ameen

How’s Caloree coming along sir?

       
Mr. Wilson's avatar
Mr. Wilson
131 posts
18 years ago
Mr. Wilson's avatar Mr. Wilson
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.

       
Cocoaholic's avatar
Cocoaholic
445 posts
18 years ago
Cocoaholic's avatar Cocoaholic

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 😉

or should it be MercEE?

       
PXLated's avatar
PXLated
1,800 posts
18 years ago
PXLated's avatar PXLated

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.

       
Jamie Poitra's avatar
Jamie Poitra
409 posts
18 years ago
Jamie Poitra's avatar Jamie Poitra

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

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

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?

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

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}Page {current_page} of {total_pages} pages {pagination_links}{/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.

       
PXLated's avatar
PXLated
1,800 posts
18 years ago
PXLated's avatar PXLated

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

       
PXLated's avatar
PXLated
1,800 posts
18 years ago
PXLated's avatar PXLated

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.

       
Derek Jones's avatar
Derek Jones
7,561 posts
18 years ago
Derek Jones's avatar Derek Jones

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.

       
PXLated's avatar
PXLated
1,800 posts
18 years ago
PXLated's avatar PXLated

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

       
Sim's avatar
Sim
8 posts
18 years ago
Sim's avatar Sim

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

       
1 2 3 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.