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.
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.
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.
(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.
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.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.