19 of 27
19
Tome (Static Pages)
Posted: 07 February 2007 03:28 AM   [ Ignore ]   [ # 325 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  599
Joined  10-14-2005
Mark Huot - 06 February 2007 06:36 PM

Try this for accessing the URL on a static page: http://expressionengine.com/forums/viewthread/38358/P234/#197756

Brilliant, thanks for that Mark. smile

 Signature 

Nathan Pitman

Nine Four Ltd - a member of the EEPro Network

Profile
 
 
Posted: 07 February 2007 02:54 PM   [ Ignore ]   [ # 326 ]  
Grad Student
Rank
Total Posts:  57
Joined  12-15-2006

I’m working on a site that is nearing 100 pages and we are using this wonderful module so our client can more easily interact with EE. I’m having some problems trying to figure out how to manage the side navigation as the user goes through the site. Currently, certain sections of the site are nearing 3rd and 4th level deep. The sidebar navigation for second level is a no brainer when using

{exp:static_page_path direction="post" page="108"}

I’m having a problem however with displaying the third and fourth level navigations in the sidebar. In a perfect world I would love to accomplish something like this:

* Cat Parent 1
* Cat Parent 2
* Cat Parent 3 (selected)
—* Child 1
—* Child 2
—* Child 3
—* Child 4
* Cat Parent 4
* Cat Parent 5

Have all the categories listed but only expand the category they are currently looking at instead of showing the complete category tree for that given parent. I don’t think this is possible with the current module, which is ok (I have posted about this before). But, I guess my question now is what do you think is the best way to accomplish this type of behavior? Should I make a bunch of separate templates with the sidebar nav hard coded the way I want and then assign them to the individual pages or maybe just make some template includes and somehow include them dynamically depending on where they are?

Has anyone else had this problem before? Any recommendations?

Profile
 
 
Posted: 08 February 2007 07:34 AM   [ Ignore ]   [ # 327 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006
practis - 07 February 2007 02:54 PM

Has anyone else had this problem before? Any recommendations?

I’m currently doing this in a very hackish way - it only works because my top level nav is hard coded.  Also I’m only showing the first level down of children, not levels below that (although you could if you want but you couldn’t selectively only show grandchildren of one child dynamically - it would be all grandchildren or none).

Here’s my (very ugly) code (at least partially borrowed from someone else in this thread if I’m not mistaken)

EDIT: Ok - only a few lines of the code - I ran into the char limit in the post:


<? $cur_page = basename($_SERVER['PHP_SELF']);  ?>
<ul id="navMain" class="navGroup">
                <
li class="<?php if( SEG(1) == "resources" ) { echo "currentSection"; } if ( SEG(1) == "resources" && !SEG(2) ) { echo " currentPage"; } ?>"><a href="{path=site_index}/resources">Resources</a></li>
                <
ul class="subnavGroup<?php if( SEG(1) == "resources") : ?> currentSection<?php endif; ?>">{exp:static_page_path direction="post" page="35" depth="1" nest="false"}<li<?php  $x = basename('{url_title}'); if( $x == $cur_page)  { echo ' class="currentPage"'; } ?>><a href="{url_title}" title="{title}">{title}</a></li>{/exp:static_page_path}</ul>
                <
li class="<?php if( SEG(1) == "events" ) { echo "currentSection"; } if ( SEG(1) == "events" && !SEG(2) ) { echo " currentPage"; } ?>"><a href="{path=site_index}/events">Events</a></li>
                <
ul class="subnavGroup<?php if( SEG(1) == "events") : ?> currentSection<?php endif; ?>">{exp:static_page_path direction="post" page="48" depth="1" nest="false"}<li<?php  $x = basename('{url_title}'); if( $x == $cur_page)  { echo ' class="currentPage"'; } ?>><a href="{url_title}" title="{title}">{title}</a></li>{/exp:static_page_path}</ul>
            </
ul>
            <
ul id="navSub" class="navGroup">
                <
li class="<?php if( SEG(1) == "about_vbsr" ) { echo "currentSection"; } if ( SEG(1) == "about_vbsr" && !SEG(2) ) { echo " currentPage"; } ?>"><a href="{path=site_index}/about_vbsr">About VBSR</a></li>
                <
ul class="subnavGroup<?php if( SEG(1) == "about_vbsr") : ?> currentSection<?php endif; ?>">{exp:static_page_path direction="post" page="11" depth="1" nest="false"}<li<?php  $x = basename('{url_title}'); if( $x == $cur_page)  { echo ' class="currentPage"'; } ?>><a href="{url_title}" title="{title}">{title}</a></li>{/exp:static_page_path}</ul>

etc.

I’ve attached a couple screenshots of what it looks like in action.  I wanted to do this using arrays and loops, but ran into some issues with parsing PHP on input/output (needed both if I remember correctly).  If someone can do these with a loop I would be really happy.

Image Attachments
Picture 2.pngPicture 3.png
Click thumbnail to see full-size image
Profile
 
 
Posted: 08 February 2007 10:25 AM   [ Ignore ]   [ # 328 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

Mark, do you have any thoughts about this possible Pages bug?

My SAEF isn’t honoring my formatting options set in the custom weblog field preferences - they all default to xhtml no matter how I set them in the preferences.  I’ve turned off all my extensions and removed all plug-ins and other modules besides Pages (I removed the pages plug-ins and extension as well to test the entry);

In this thread Robin tested on her end and a SAEF honors the formatting settings in a normal situation for the version/build I’m running (1.5.2).

I can’t think of anything it could be other than the Pages module. Any ideas?

Thanks for your help - I’ve spent hours (days yet?) trying to figure this out and/or work around it…

Profile
 
 
Posted: 08 February 2007 10:34 AM   [ Ignore ]   [ # 329 ]  
Grad Student
Rank
Total Posts:  57
Joined  12-15-2006

Thanks Pie Man!!

I thought thats what I was going to end up doing but I just wanted to make sure I wasn’t missing some other way of doing it. Would be nice if we could do it in a loop but I’m not exactly sure how we would accomplish that (beyond using the query module to do the entire process our selves).

Profile
 
 
Posted: 08 February 2007 10:36 AM   [ Ignore ]   [ # 330 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1194
Joined  01-05-2006

So when you remove the pages module/plugins/extensions it works correctly?  I can’t think of anything off the top of my head but if you could send me a link to a sample page and maybe some sample template code I could take a look at it.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 08 February 2007 10:51 AM   [ Ignore ]   [ # 331 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006
Mark Huot - 08 February 2007 10:36 AM

So when you remove the pages module/plugins/extensions it works correctly?  I can’t think of anything off the top of my head but if you could send me a link to a sample page and maybe some sample template code I could take a look at it.

Well that’s the thing, I’m not sure - I’m scared to remove the pages module. If I pull that am I going to lose anything?

Profile
 
 
Posted: 08 February 2007 10:55 AM   [ Ignore ]   [ # 332 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1194
Joined  01-05-2006

Yes, you will loose your configuration settings if you remove the module.  However the module has no interaction with the templates, so I would first try removing the extension and plugins as they don’t have any settings associated with them.  Let me know if that helps.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 08 February 2007 11:28 AM   [ Ignore ]   [ # 333 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006
Mark Huot - 08 February 2007 10:55 AM

Yes, you will loose your configuration settings if you remove the module.  However the module has no interaction with the templates, so I would first try removing the extension and plugins as they don’t have any settings associated with them.  Let me know if that helps.

I’ve done this and the problem remains. Submitting the SAEF puts all options in with formatting of xhtml (none are set this way in the prefs). I’d give you a link to the page but currently it’s being developed locally here on my machine. If needed I could probably give you my IP and open this machine up to the net - I’m on Comcast though and I’ve heard they switch IPs pretty regularly. PM if you’d like to try that…  Or would it help for me to give you the template code?

Profile
 
 
Posted: 08 February 2007 11:40 AM   [ Ignore ]   [ # 334 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

Hold the phone - I’m an idiot.  I’m building a custom SAEF instead of using the dynamic generation.  I have to include hidden fields with the formatting options for each field.

Sorry for the confusion.
red face  downer

Profile
 
 
Posted: 08 February 2007 02:13 PM   [ Ignore ]   [ # 335 ]  
Grad Student
Rank
Total Posts:  57
Joined  12-15-2006

I’m probably missing something obvious, but how do I display the content from pages that have been made dynamic?

Do I still use the {exp:wblog:entries category=”{static_page}”}?

Profile
 
 
Posted: 08 February 2007 02:15 PM   [ Ignore ]   [ # 336 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1194
Joined  01-05-2006

@practis: you can just code that tag as you would normally with {exp:weblog:entries weblog=[weblog_name]} where [weblog_name] is the name of your dynamic weblog.
@The Pie Man: I’m just glad you got it figured out!

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 08 February 2007 04:50 PM   [ Ignore ]   [ # 337 ]  
Summer Student
Total Posts:  3
Joined  08-22-2005

I am super fried, so bear with me…

I have followed all the step by steps and everything. Things seem to be working but then when I go to put the content into a static page it ends up showing up in the “news” category which is set to dynamic.

The “news” page has it’s own template and all the rest use the static template I created.

HELP, PLEASE!

Profile
 
 
Posted: 08 February 2007 06:08 PM   [ Ignore ]   [ # 338 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1194
Joined  01-05-2006

Do you mean it ends up showing up on the front end?  Can you post your category list and some sample template code?

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 08 February 2007 06:19 PM   [ Ignore ]   [ # 339 ]  
Summer Student
Total Posts:  3
Joined  08-22-2005

Category List:
[S] One To One Learning
[D] News (2 entries)
[S] iSummit
- [S] Teachers
- [S] Administrators
- [S] IT Professionals
[S] Members
[S] Resources
[S] Contact

These all belong to the weblog “Content” and have the Category Group of “Content Pages.” There is a static template for all the pages except the news page, which has its own. However, when I attempt to publish the content for any of the static pages they end up displaying on the front end under “News”.

The actual pages arent working either.

Here is the static template:

{assign_variable:my_weblog="content"}
{assign_variable
:my_template_group="staticpages"}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">

<
head>
<
title>{exp:weblog:info weblog="{my_weblog}"}{blog_title}{/exp:weblog:info}</title>
<
meta http-equiv="Content-Type" content="text/html; charset={charset}" />

<
link rel='stylesheet' type='text/css' media='all' href='{stylesheet={my_template_group}/site_css}' />
<
style type='text/css' media='screen'>@import "{stylesheet={my_template_group}/style}";</style>

<
link rel="alternate" type="application/rss+xml" title="RSS" href="{path={my_template_group}/rss_2.0}" />
<
link rel="alternate" type="application/atom+xml" title="Atom" href="{path={my_template_group}/atom}" />

</
head>
<
body>
{embed="includes/navigation"}

<div id="contentWrapper">

{embed="includes/branding"}

<div id="primaryContent">

{exp:weblog:entries category="{static_page}" dynamic="off" }

<h2 class="mainTitle">{title}</h2>

{body}

{extended}

{
/exp:weblog:entries}

</div><!-- primaryContent -->

And the news template is quite a bit the same:

<div id="primaryContent">

     <
h2 class="mainTitle">News</h2>

{exp:weblog:entries weblog="{my_weblog}" orderby="date" sort="desc" limit="15" disable="member_data|trackbacks"}

<div class="entry">

{!--date_heading}
<h3 class="date">{entry_date format=' %l, %F %d, %Y '}</h3>
{/date_heading--}

<h3 class="articleTitle">{title}</h3>

{body}

{extended}

<div class="posted">Posted by {author} on {entry_date format='%m/%d'} at {entry_date format='%h:%i %A'}

{if allow_comments}
({comment_total}) <a href="{url_title_path="{my_template_group}/comments"}">Comments</a> &#8226;
{/if}
<a href="{title_permalink={my_template_group}/index}">Permalink</a>
</
div>

{paginate}
   
<div class="paginate">
   <
span class="pagecount">Page {current_page} of {total_pages} pages</span>  {pagination_links}
   
</div>
{/paginate}

</div>

{/exp:weblog:entries}

</div><!-- primaryContent -->

I am new to EE, but this seems like it was making tons of sense, but now I am lost.

Cheers.

Profile
 
 
Posted: 09 February 2007 12:16 PM   [ Ignore ]   [ # 340 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  106
Joined  07-15-2006

OK, so I have been battling with the whole {segment} thing in an attempt to get styling to work with my navigation, thought it was me being dense, found this post, figured maybe I wasn’t so dense, read the post, realised I really am that dense red face

I know this will make me appear really stupid, but I can live with that if I can get this sorted, so here goes…

question 1 to Mark -is the new module imminent, if so should I wait….....

question 2, assuming that Mark has a life outside of the Pages module (surely not, we all cry - for the record Mark, you have done an incredible job with this, and I can see from this thread that mine is just one voice among many)... please could someone walk me through step by step how to get that work around?

Like Twin, I am trying to get an embedded Nav template to work, but unlike Twin, I have no clue where to put the php and what Mark meant by changing the conditionals - which conditionals?

Say my code is this:

{exp:static_page_path nest="true" direction="post" page="0" depth="1"}<li {if  url_title == "{segment_1}"} class="mainCurrent" {else:if} class="mainLink" {/if}><a href="{url_title}" title="{title}">{title}</a></li>{/exp:static_page_path}

for top level navigation, and this…

{exp:static_page_path nest="true" direction="post" page="20" depth="1"}<li {if  url_title == "{segment_1}"} class="subCurrent" {else:if} class="subLink" {/if}><a href="{url_title}" title="{title}">{title}</a></li>{/exp:static_page_path}

for sub navigation, what do I need to do? 

I have stripped index.php out of my URL’s, and I hit on Segment_1 and _2 as my segments as they corresponded to the segments in the URL as I could see it, though simply doing <p>{segment_1} suggested I was sorely mistaken there downer

Apologies if this is abusing the forum, but I didn’t know where to go with this after many hours pf banging my head against a wall, and I’d love someone to show me what I am doing wrong/not doing at all/need to do.

Thanks in advance!

 Signature 

Don’t settle for existence

Profile
 
 
Posted: 09 February 2007 03:40 PM   [ Ignore ]   [ # 341 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1194
Joined  01-05-2006

have you read the thread a little further up the page?  http://expressionengine.com/forums/viewthread/38358/P324/#204803 it details pretty well how much PHP you’ll need in order to get something like this working.  If that doesn’t help, or if you’ve already tried that PM me and we’ll discuss this some more directly relating to your site.

mark.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 09 February 2007 03:44 PM   [ Ignore ]   [ # 342 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  106
Joined  07-15-2006

D’uh!  red face  I totally Missed that.  Sorry!  I’ll give that a whirl and see what happens.  Thanks!

 Signature 

Don’t settle for existence

Profile
 
 
   
19 of 27
19
 
‹‹ Solspace Tag Cloud      Files Module ››
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 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66467 Total Logged-in Users: 30
Total Topics: 84862 Total Anonymous Users: 15
Total Replies: 455346 Total Guests: 136
Total Posts: 540208    
Members ( View Memberlist )