Hi folks, I’m still using 1.3.1 for a charity site that I’m doing.
Been following Travis’ tutorial on http://jambor-ee.com/tutorials/structure/ which has been great.
I have the sample working on http://stage.findlayfamilynetwork.org/ - however I’m having trouble with the ‘news’.
The main news page shows fine but won’t list any news stories. The template I’ve copied from the examples provided
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<title>Structure Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset={charset}" />
<link rel='stylesheet' type='text/css' media='all' href='{stylesheet=site/site_css}' />
</head>
<body class="home">
<div id="container">
<h1>Structure Demo</h1>
<ul id="nav">
<li{if segment_1 == ""} class="here"{/if}><a href="/">Home</a></li>
<li{if segment_1 == "services"} class="here"{/if}><a href="/services">Services</a></li>
<li{if segment_1 == "about"} class="here"{/if}><a href="/about">About Us</a></li>
<li{if segment_1 == "news"} class="here"{/if}><a href="/news">News</a></li>
<li{if segment_1 == "contact"} class="here"{/if}><a href="/contact">Contact Us</a></li>
</ul>
<div id="content">
{exp:structure:nav_sub}
<div id="content_main">
{exp:structure:breadcrumb}
{exp:weblog:entries}
<h2>{title}</h2>
{content}
{/exp:weblog:entries}
{exp:weblog:entries weblog="news" dynamic="off"}
<div class="item">
<h3><a href="http://{page_url}">{title}</a></h3>
{entry_date format="%d/%m/%Y"}
</div>
{/exp:weblog:entries}
</div> <!-- close #content_main -->
<div> <!-- close #content -->
<div id="foot">
Copyright © nGen Works 2008
<div> <!-- close #foot -->
</div> <!-- close #container -->
</body>
</html>
I created http://stage.findlayfamilynetwork.org/index.php/site/test to make sure the entries loop was working and it is.
Any ideas?
Thanks, S
Maybe it’s a slight code error or not closed tag - that should work… Have you tried a test page (within Structure) and ONLY having the news loop? I would strip things out and work backwards. Make sure you have a status group assigned to the news weblog also, it won’t show entries if they aren’t set to open when published.
Maybe I’m just being dense, but I am having some trouble. I am building a site for an academic program that has several campuses. I have a template and weblog for ‘locations’. For each location we wan to list a few topics.
Location 1 -intro -distinctives -cost -apply Location 2 -intro -distinctives -cost -apply Location 3 -intro -distinctives -cost -apply
I want the page to list the 3 main topics on the left as subnav.
{exp:structure:nav_sub start_from="/locations/" show_depth="0" css_class="topnav" current_class="currentSection"}
That works. I see the list of locations just fine.
However when I click on one it just adds the ‘currentSection’ class and changes the link color. If I use this:
{if segment_2 == ""}
{exp:structure:nav_sub start_from="{segment_1}" show_depth="0" css_class="topnav" current_class="currentSection"}
{if:else}
{exp:structure:nav_sub start_from="{segment_2}" show_depth="0" css_class="topnav" current_class="currentSection"}
{/if}
The list of locations shows, but when I click on one of them I get a blank space with nothing.
Also, does it mater if I have the same titles for each location’s children? IE each one has a intro, distinctives, cost, apply link. Is there a better way to do this?
another issue, not neccessarily structure, but how to style its output. I have a left side sub nav. Some have one level of nav, others two. It works fine, but the CSS stying is being a real pain. The tag in the template is:
{
exp:structure:nav_sub start_from="/{segment_1}" show_depth="2" css_id="none" show_level_classes="no" current_class="currentSection"}
That outputs:
<div id="sideNav" class="grid_3">
<h1>About</h1>
<ul><li class="currentSection"><a href="/index.php/about/overview/">Overview</a>
<ul>
<li><a href="/index.php/about/overview/what/">What </a></li>
<li><a href="/index.php/about/overview/difference/">Difference</a></li>
<li><a href="/index.php/about/overview/founding/">Founding</a></li>
<li><a href="/index.php/about/overview/college-credit/">College Credit</a></li>
<li class="last"><a href="/index.php/about/overview/faq/">FAQ</a></li>
</ul>
</li>
<li class="currentSection"><a href="/index.php/about/curriculum/">Curriculum</a>
<ul>
<li><a href="/index.php/about/curriculum/overview/">Overview</a></li>
<li><a href="/index.php/about/curriculum/module-1/">Module 1</a></li>
<li><a href="/index.php/about/curriculum/module-2/">Module 2</a></li>
<li><a href="/index.php/about/curriculum/module-3/">Module 3</a></li>
<li class="last"><a href="/index.php/about/curriculum/module-4/">Module 4</a></li>
</ul>
</li>
<li><a href="/index.php/about/teaching-method/">Teaching Method</a></li>
<li><a href="/index.php/about/practicum/">Practicum</a></li>
<li class="last"><a href="/index.php/about/spiritual-growth/">Spiritual Growth</a></li>
</ul>
</div>[/code]
The CSS is:
[code]#sideNav ul {
margin-top: 15px;
}
#sideNav li {
background-image: url(../images/interface/sideNavDivider.jpg);
background-repeat: no-repeat;
display: block;
padding-top: 9px;
padding-bottom: 9px;
}
#sideNav li a {
font-size: 14px;
text-decoration: none;
font-weight: normal;
color: #005a9c;
padding-left: 20px;
}
#sideNav li a:hover {
color: #8dc63f;
}
#sideNav li .currentSection {
background-image: url(../images/interface/sideNavPointer.png);
background-repeat: no-repeat;
color: #8dc63f;
background-position: 0px 0px;
}
/* sideNav Second Level Nav */
#sideNav ul ul{
margin: 0px;
padding: 0px;
}
#sideNav ul ul li{
background-image: none;
padding-top: 2px;
padding-bottom: 2px;
}
#sideNav ul ul li a {
font-size: 12px;
text-decoration: none;
font-weight: normal;
color: #005a9c;
padding-left: 40px;
}
#sideNav ul ul li a:hover {
color: #8dc63f;
}
#sideNav ul ul li .currentSection {
background-image: url(../images/interface/sideNavSubPointer.png);
background-repeat: no-repeat;
color: #8dc63f;
background-position: 20px 0px;
}
The parent nav items should have a large arrow to the left, The child nav items should have a smaller arrow to the left. Both should change color when selected. The big arrow does show up when I select a child entry, but not the parent. No arrow shows up when a parent entry is selected. In both child and parent entries, they do not change color when selected.
I’ve looked over turorials, stared at my code, played around with it (I can get the smal and bigl arrow to show up and the color to change when a child entry is selected if I do this:
#sideNav ul li .currentSection a{ background-image: url(../images/interface/sideNavSubPointer.png); background-repeat: no-repeat; color: #8dc63f; background-position: 20px 0px; }
Changing it to:
#sideNav ul li .currentSection a{ background-image: url(../images/interface/sideNavSubPointer.png); background-repeat: no-repeat; color: #8dc63f; background-position: 20px 0px; }
yeilds a big arrow next to child entries (no color change in the link text as there should be).
I played around with adding the nav-level-1 and 0 classes, but no joy. Sighhhh, just not my day. Any ideas?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.