Expression Engine 2 Next/Previous Entry Linking with Full Entries List - expressionengine

I want to use the Next/Previous Entry Linking technique in EE2:
{exp:channel:next_entry}
<p>Next entry: {title}</p>
{/exp:channel:next_entry}
{exp:channel:prev_entry}
<p>Previous entry: {title}</p>
{/exp:channel:prev_entry}
When this works, I'm on a single entry ie. awesome.com/index.php/my-cool-entry, I can click page through the entries in that channel.
Is it possible to ALSO display a full list of the entries on this page while I'm looking at one article? I want to be able to show the list of entries as a way to navigate to a particular article.
Think of it like the way {pagination_links} builds links:
First Page < 1 2 3 > Last Page except instead of numbers I want to display parts of that entry, rather than just a number.
What bothers me is that {paginate} generates ugly URLs ie. awesome.com/index.php/articles/P1, I'd rather have awesome.com/index.php/articles/my-cool-entry. exp:channel:next_entry/prev_entry preserves the URL_title!
Is there a plug-in that can handle this kind of thing?

Embedding a template is the way to go.
Create a new template with an {exp:channel:entries} loop. Within that you can dump out the entries you want and display any info you want from them.
One thing to make sure of is to use the dynamic="no" parameter within the {exp:channel:entries}. It'll go something like this:
In your article page, embed another template:
{embed="article/full_list"}
And within the article/full_list template use a loop like:
{exp:channel:entries dynamic="no" channel="[YOUR CHANNEL]" LIMIT="10"}
{title}
{/exp:channel:entries}

Related

Creating user editable chunk or snippet in ModX

I'm trying to create a chunk or a snippet a user can edit without touching the code. I thought it would be the best to include the content of a page since the pages use an editor. Can anyone tell me how I can accomplish this? Or tell me the best way to do it?
If I understand you correctly, you want to create, for example, a footer chunk with 3 editable regions.
I would do this by dedicating 3 resources for each editable region. Have the user make their changes via TinyMCE in these 3 resources (perhaps nest them in parent labled accordingly, eg: "Footer Columns"). Make sure they're hidden from menus so they don't come up by mistake.
Then use getResources within your chunk to display each. Eg:
<div class="footerchunk">
[[getResources?
&resources=`45,46,47`
&tpl=`footerColItem`
&depth=`0`
&limit=`3`
&includeContent=`1`
&showHidden=`0`
]]
</div>
Note that the resources in my example would correspond to the resources your using to allow the users to enter the text.
You would be required to build a footerColItem chunk, perhaps something like:
<div class="footercol">
[[+content]]
</div>
Note also the use of &showHidden=0
This is all from memory, so can't guarantee this will work straight away. Look at https://docs.modx.com/extras/revo/getresources for more info

Stash : Conditional Content

First off, a caveat ... I am brand new to Stash. I've heard a lot about it but this is my first time actually playing with it. I get the concept, but am having a hard time figuring this one thing out.
I have a main "wrapper" file and everything within that wrapper stays the same. I would like the option however, to be able to toggle the sidebar on and off if I need to.
I wouldn't think I would need a totally separate layout wrapper would I?
Is there a way to use a boolean variable within stash? (e.g. 2col=TRUE) or am I thinking about it wrong?
Thanks in advance for your help!
Generally what I'd do here is setup multiple Stash gets within the wrapper. Then in your individual templates you can set both the sidebar and the main content area. For parts where you might be repeating content, like the opening and closing divs of a sidebar, you can always drop some snippets inside the stash.
You can also use exp:stash:not_empty [docs] to wrap around the div or container for your sidebar within the wrapper.
I usually use one wrapper for every template. It'll contain an {exp:stash:get name="content"} tag, like yours, which contains the only variable content within.
In my individual templates, I embed the wrapper at the beginning using a regular EE embed ie. {embed="includes/wrapper"}.
Then I stash the content to be inserted into the wrapper using the {exp:stash:set name="content"} tag.
This seems like what you're doing anyway.
If I want to conditionally show a sidebar, I might just pass a variable into the embed.
eg. {embed="includes/wrapper" show_sidebar="yes"}
In my wrapper I would do this:
{if embed:show_sidebar}
Sidebar stuff.
{/if}

How to apply images conditionally using entries and categories?

Using version 2.5.3 of ExpressionEngine, I have a list of products displayed by category, but I need the premium products among this list being featured with a small star image. How do you call conditionally this little stars besides the {title}?
At the moment this code shows stars for all products and that is not ideal.
<ol class="voices-list">
{exp:channel:entries channel="product" orderby="title" sort="asc" category="2&6" dynamic="no"}
<li>{title}<img class="feature_icon medium" src="{root_url}img/audio/smallstar.png" alt="star"></li>
{/exp:channel:entries}
</ol>
I need your help, please.
Best to set up a new checkbox field named "is_premium" with the value set to "y".
Next, edit each premium product entry and check the box and save.
Finally, in your template use this conditional.
{if is_premium == "y"}add star code{/if}
I like the approach shown in the answer posted by #MediaGirl and have used it many times.
An alternative approach is to handle it with a custom status rather than a custom field, if only to have the ability on the main edit screen to quickly and easily see and sort the list by "premium" (Zenbu could add the custom field to the edit screen, of course). The conditional would be similar, and of course the entries loop would need to have the status param of "open|premium".

How Can I Use Shadowbox to Extract Text Only from Webpage?

I have an article set up in Joomla that displays Terms and Conditions for the site users. I would like this to show up in a shadowbox when a user clicks a link. Here is the current anchor text example:
Terms and Conditions
This works out great for displaying the entire web page, but what I would like to do is just display the article text on the page (plain with a white background). Is this in someway possible with shadowbox? If so, how?
If I'm understanding you correctly - you want to suppress the modules and other periphery from your 'page' when it is loaded in the shadowbox.
Add ?tmpl=component to the url of your link.
You can do this with a div element and css shadow effect.
How to show/hide div is explained here:
http://www.randomsnippets.com/2008/02/12/how-to-hide-and-show-your-div/
How you can add shadow is explained here:
http://placenamehere.com/article/384/css3boxshadowininternetexplorerblurshadow/
I believe there are some components to do this - but you may have to get creative to do it without pulling the whole page with an a href tag.
In the database there's a particular area that holds that specifically and you could write a little query to just pull that information specifically and put it in the shadowbox, but what that query would look like I'm not sure.

Pagination on Single-Entry view in ExpressionEngine

I am building a website with ExpressionEngine as the CMS. There is a "Work" section that displays all the projects, and a detail view that shows each project individually. It is at this point, on the single-entry view that I would like to have "prev" and "next" pagination. In my tests I have made it work when the URL is "somedomain.com/index.php/work/detail/" but it does not work when the specific entry is part of the URL: "somedomain.com/index.php/work/detail/some_project/"
I've tried putting the pagination code outside of the {exp:weblog:entries} tag as well as within it, but to no avail. This is what my pagination code looks like:
{paginate}
<ul>
{if previous_page}
<li>< previous</li>
{/if}
{if next_page}
<li>next ></li>
{/if}
</ul>
{/paginate}
You are using pagination for lists of entries, what you need is the next / previous entry tags:
http://expressionengine.com/user_guide/modules/channel/entry_linking.html
Hmm. I'm not sure what the issue is here, as I've never used the {pagination} tag in that way. After checking out the docs, I see that the example code for prev/next links inside of the {pagination} tag is wrapped inside of an {exp:comment:entries} loop instead of the normal {exp:channel:entries} loop.
The docs aren't very clear about the scope of this particular feature of the {pagination} tag. You might want to double check that, in your {exp:channel:entries} loop, you haven't included pagination as a value in the disable parameter.
You could also check out the page in EE's user guide about Next/Prev Linking, which details the use of {exp:channel:next_entry} and {exp:channel:prev_entry} tags in place of the {pagination} tag that you've been using. I've used these tags without a hitch, so I definitely recommend trying them if you can't get your method to work.
Best of luck!

Resources