Hi openmotive,
I’m currently achieving that using the sql query module and directly querying the categories table to spit out a fully dynamic left-nav from tome:
{exp:query sql="SELECT cat_name, cat_id FROM exp_categories WHERE cat_url_title = '{seg_1}'"}
<h3>{cat_name}</h3>
{exp:static_tome_path direction="post" page="{cat_id}"}
<a{if {my_seg} == "{short_name}"} class="youAreHere"{/if} href="{url_title}">{title}</a>
{/exp:static_tome_path}
{/exp:query}
(I’m also using the seg_1 to seg_9 variables in path.php as mentioned here)
For the youAreHere class, I have defined a variable “my_seg” (at the top of the template) to compare against the short_name like so:
{assign_variable:my_seg="seg_{static_page_level}"}
James
I think this is a Tome problem but it’s too weird to know for sure.
Site is structured with Tome. “Who We Are” is a static category. “Press Releases” is a dynamic category. “Site Structure” is the category group.
If “Press Releases” is placed into “Site Structure” without a parent, the dynamic temlate is able to pull the data from the data stack.
If “Press Releases” is placed with “Who We Are” as a parent category, the correct template comes up but no data is displayed. Debugging says “Returning No Results Content”.
This is where it gets strange: If I change the title of “Who We Are” to “Who”, “Who We”, or “Who We Care” the dynamic temlate is able to pull data. If I place “Press Releases” under any other category, it works. If I place any other dynamic category under “Who We Are” the template returns “Returning No Results Content”. I have deleted “Who We Are” twice and recreated it and the same happens. Any categry named “Who We Are” seems to cause child categories with dynamic templates to fail to find their data stack. One note is that the original “Who We Are” was named “About Us”, I changed the name after the child categories were already assigned. I’ve checked the database tables and do not see anything outstanding but I am new to EE & Tome so I might not know what to look for. Any advice is highly appreciated as the client probably would rather not have their “Who We Are” page called “Who we Care” or “Who We Dare”.
I’ve been reading about page/tome for most of the day, and having read through the 27 page thread on the original ‘Page’ module, I decided to give it a go using the one that comes with EE 1.6.2 (as recommended by Mark Huot, top man!)
Unless I’m missing something obvious (and don’t rule out that possibility!), it seems the EE version is a completely different beast. No auto breadcrumbs/navigation, and no ‘defining a structure in categories’. It seems all you can do is to add a URI in the page tab during a publish, and that overrides a default.
Anyways, I downloaded and installed the Tome version and I far prefer the way it works, thinking from the perspective of the people that will be using the site when it’s complete moreso than myself.
I guess my question is, am I missing a trick with the EE Pages module?
No, you aren’t missing a trick.
It seems that the “Pages” module that comes with EE is a one trick pony. Make a static page, assign it a URL. If you need to link to that page, you’ll have to manually do so in your navigation.
The “Tome” module, however, is a much more robust system. It manages the structure of both a static and a hybrid static/dynamic site with aplomb. It takes some getting used to as mixing static and dynamic content requires you to think differently about the URL structures (static pages follow the structure of the categories, whereas a dynamic section…while it can appear heirarchically somewhere within your static structure…uses the standard template group/template name URL structure.)
A good tip if you are using Tome. Make sure that you don’t name any of your template groups the same name as any of your top level categories in tome. This will confuse the heck out of the system.
Bottom line: To manage a mixed static/dynamic site, Tome coupled with EE is one of the best CMS solutions I’ve found (and believe me, we’ve been through alot of CMS’s before settling on this solution.)
OK - I hope this is an acceptable place to be asking questions about Tome because I have one and you guys clearly have experience with it. If not, apologies.
As stated before, I’m looking at this from the perspective of the user (as we hope to develop sites in EE and pass them over, as I’m sure many of you do also). The one problem with Tome I see so far is that the user can go to the pages/category view and edit the (say) “About us” static page really nicely, no problems there. But they can also go to publish, choose “About us” from the categories and publish another page which seems to overwrite the original (although both remain live).
Does anyone have a cunning ploy to get around this or do we have to rely on the client not getting it wrong?
It’s something that you just don’t want the client doing.
We setup a tome tab and call it “Site” for our clients and advise them to always go through “Site” to make changes to existing static pages or add new dynamic pages. We do have a few other weblogs used for creating custom alternative home landing pages and our client’s HTML newsletters that aren’t a part of the tome-based structure. Those are the only items that we advise the clients use the “Publish” tab for. So far, no one has screwed it up. I think because having a tab for tome with a name that makes sense to them like “Site” or “Structure” (“Tome” is essentially a meaningless term from their perspective) really has helped keep them in line using the tome-based editing/adding.
That’s a good plan, I like that!
I’m having a problem at the moment… I have a static page called ‘The Team’. What I want to do is to show the summary, then a list of team members, then the rest of the content. So the client can admin the actual ‘team’ content as a static page, and also be able to add team members..I’m sure you get my drift!
The template page looks a little like this:
{exp:weblog:entries category="{static_page}" limit="1" dynamic="off"}
<h1>{title}</h1>
{summary}
{embed="/includes/team"}
{body}
{extended}
{/exp:weblog:entries}
And the embed ‘includes/team’ looks like this:
{exp:weblog:entries weblog="team_members"}
{title}
{bio}
{/exp:weblog:entries}
Is there anything obvious that’s wrong with this that anyone can see? I was thinking the include being inside first weblog:entries (which is limited to 1) might be an issue, but it still won’t appear if I move the embed outside of that tag pair.
EDIT: I added ‘dynamic=”off”’ to the embed and it seems to be working!
I now have this working almost perfectly. The only remaining problem is that I can’t seem to get my detail page to work properly. So “http://site/about/the-team/jimmy-smith’ goes to the right page with the right template, but shows all team members rather than the one I want. This seems too straightforward to be anything other than user error!
Hi Andy,
I think your problem is caused by the fact that you can’t use the {static_page} variable if you are not inside a Tome page.
I have a similar setup on this site: www.organizational-edge.com/business_psychology/about_oe/the_people/
hope this helps,
James
Hi all…am a bit of a newbie to EE, but must say…I am loving it (generally!). Other then hard coding navigation (which a lot of people recommend for some reason!?!?) I am finding this the most difficult part of using EE. Enter the Tome module to save the day. I think I have the basics of this module, and can pull out the static page list as a navigation list, and everything links beautifully. Nice one!
Okay…to my problem. I know that it is documented that you can’t use exp:static_tome_path on a page that is not defined in the static category list (at least that is my understanding). Am I missing something, or doesn’t this negate the entire thing (unless your whole site is listed in the static category list which isn’t alway what you want)?
For example here is a basic structure of:
Note that the first one can be TWO urls. The first one (index.php/home) works fine because it is in the static category list…however the second one (which is used through the site by {homepage}, plus is probably how most people will enter the site) doesn’t work. It is the same template, same content, etc, but when the embeded navigation list is called it seems to ignore the tag an just write out {title} (rather then the actual title).
There are other examples where this is going to happen…for example under Products I will have a comments display section (http://www.domain.com/index.php/products/comments/my_fantastic_product/). The ‘comments’ template isn’t listed in the static category list…so my nav won’t work on this page either.
Am I missing something, or is this how it works by design?
Based on the usability of this Module (for my client), I am very very keen to use it to manage the overall site nav…but the site nav must work across ALL pages in the site (well dah!).
Thanks in advance
PS: I have gotten this far with using EE from you guys on the forum. Thanks for all the good work you do…it is much appreciated by the quiet masses.
Hi again. I think I might have answered my own question…but I am wondering if there is a better way of doing this.
THE ISSUE:
Imagine these two URLs - 1. http://www.domain.com/index.php 2. http://www.domain.com/index.php/home
Both go to the same page, and do the same thing (if “home” is one of the categories, and points to the template site/index). The second one works fine, however the first one doesn’t work (no content, {static_tome_path} tag doesn’t work, etc). The issue it seems is that the Module requires AT LEAST one segment to determine the correct static content to display. So how do we fix the first URL so both work fine?
THE (HACKY) FIX:
I have added the following line to “modules/tome/ext.tome.php” -
if ($IN->SEGS[1] == “”) $IN->SEGS[1] = ‘XXX’;
where XXX is the url to your home page (in my case “home”). Okay, so this sucks for the next project I work on where I want the home page url to be called “my_home”. I would need to remember to go back into the code, make the change, etc.
THE (BETTER) FIX:
Is it possible to add a radio button to the Configure Tome page which would allow us to check a default home page?
OTHER STUFF:
It would be great to see a “hide from the menu” checkbox on the Configure Tome page as well. I have added pages called ‘archive’ and ‘comment’ to the list, which I want as static, but no to display in any menu listing.
Thanks again for all the hard work everyone puts into this forum.
Hi Agun,
For the home page problem, I use a simple php 301 redirect on a site’s main index template so that it points to the Tome-friendly version. Doing this has the added benefit that as far as Googlebot is concerned, your home page url is www.yoursite.com/keyword_or_phrase/home which may get you a couple extra notches on the pagerank-o-meter. (Then again it might also do the exact opposite, who knows - this SEO stuff is quite a black art.) Code is here:
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.domain.com/index.php/home");
exit();
?>
As for excluding Tome items from displaying as navigation items, I’m currently doing that by a combination of Mark’s ‘checkbox’ module, the sql query module, and some dynamic CSS to set those Tome items to display:none. It would obviously be better if Tome didn’t generate them in the first place, but I spent hours trying to figure that one out with no success. In the same way, I also use Tome to spit out a footer navigation, but this time I have all the items turned off by default with display:none and then have another checkbox for each item if the site owner wants to add the item to the footer nav. Code for that is here if it helps:
{!-------switch off topnav items if ticked for exclusion and switch on footer items if ticked for inclusion -------}
<style type="text/css">
#topNav .home,#footerIn ul li{display:none;}
{exp:query sql="SELECT cat_url_title FROM exp_categories INNER JOIN exp_weblog_data ON field_id_5 = cat_name WHERE exp_weblog_data.field_id_12 = 'Exclude from primary navigation'"}
#topNav .{cat_url_title} {display:none;}
{/exp:query}
{exp:query sql="SELECT cat_url_title FROM exp_categories INNER JOIN exp_weblog_data ON field_id_5 = cat_name WHERE exp_weblog_data.field_id_13 = 'Add to footer navigation'"}
#footerIn ul li.{cat_url_title} {display:block;}
{/exp:query}
</style>
Good luck,
James
Thanks James…your answer is clear and very much appreciated. In the short terms I am going to implement the changes almost exactly as you have suggested. My feeling for the longer term is that I might have a dig into the Tome module and make the changes so that they are “built-in”. If I get to that point, I will post them for all to share.
Thanks again. Great tools like EE are only as good as their active community. Clearly EE has a large active community, which just makes me what to support it all the more.
One very happy customer.
😊
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.