Gossamer Forum
Quote Reply
3.2 template changes
Kudos to Brewt and the dev team on the additional include's for the luna templates!

The additional templates (include_contentwrapper_top/bottom.html and include_content_top/bottom.html)
are a super-cool and much needed addition to the templates. Thank you very much.

That said, it needs to be taken 1 tiny step further wrt the Crumb and <h2>Heading</h2>.
Please try to understand what I am asking and let me know if this idea could make it into a future
release (although now would be a great time as so many templates have changed anyways).

Simply put, I need to swap the order of the Crumb and <h2> heading. Very simple,
but currently requires editing EVERY template. The result of switching the order
of these 2 item can be seen here. Click through the Main menu to see diff pages.

Here's the deal...
Every template is almost identical regarding the first few lines inside 'content'.
1 - There is the Crumb
2 - There is the Heading
Code:
<div id="content">
<%include include_content_top.html%>

<div class="crumb"><%Links::Utils::format_title($main_title_loop, separator => $crumb_separator, no_escape_separator => $no_escape_crumb_separator, include_home => 1, link_type => 2)%></div>
<h2>Add a Link</h2>

<p>
Please yadda yadda yadda.
</p>

...

<%include include_content_bottom.html%>
</div>


There needs to be 1 more template called include_crumb.html. Inside this template,
you could put all crumbs and <h2> headings in this template. They could then
be rearranged according to site needs.

Example include_crumb.html. The important thing to note is that crumb and h2 have been reordered.
Code:
<%if page_id eq 'category'%>
<h2>
<%category_short%>
<%~if config.newsletter_enabled and not config.newsletter_global_subscribe%>
<%~Links::Newsletter::subscription_info($ID)%><%-- SubscriptionStatus: 0 = not subscribed, 1 = indirectly subscribed, 2 = directly subscribed --%>
<%if SubscriptionStatus == 2%><span class="hsmall">(<a href="<%config.db_cgi_url%>/subscribe.cgi?action=unsubscribe;ID=<%ID%>" title="Unsubscribe to stop getting updates from this category">Unsubscribe</a>)</span><%elsif SubscriptionStatus == 1%><%else%><span class="hsmall">(<a href="<%config.db_cgi_url%>/subscribe.cgi?action=subscribe;ID=<%ID%>" title="Subscribe to get updates from this category">Subscribe</a>)</span><%endif%>
<%~endif%>
</h2>
<div class="crumb"><%Links::Utils::format_title($title_loop, separator => $crumb_separator, no_escape_separator => $no_escape_crumb_separator, include_home => 1, link_type => 2)%></div>

<%elseif page_id eq 'detailed'%>
<%if next_url or prev_url%><p class="linknav"><%if prev_url%><a href="<%prev_url%>"><img src="<%Links::Utils::image_url('paging-prev.gif')%>" alt="&lt;" /> Previous</a><%endif%><%if next_url and prev_url%> | <%endif%><%if next_url%><a href="<%next_url%>">Next <img src="<%Links::Utils::image_url('paging-next.gif')%>" alt="&gt;" /></a><%endif%></p><%endif%>
<h2>
<%Title%><%if URL and URL ne 'http://'%> <span class="hsmall">(<a href="<%config.db_cgi_url%>/jump.cgi?ID=<%ID%>">Visit this link</a>)</span><%endif%>
<%if isNew%><span class="new-item"><span>new</span></span><%endif%>
<%if isChanged%><span class="updated-item"><span>updated</span></span><%endif%>
<%if isPopular%><span class="popular-item"><span>popular</span></span><%endif%>
<%~if paymentsEnabled%>
<%if isUnpaid%><span class="unpaid-item"><span>unpaid</span></span><%endif%>
<%if isExpired%><span class="expired-item"><span>expired</span></span><%endif%>
<%if isFree%><span class="free-item"><span>free</span></span><%endif%>
<%~endif%>
</h2>
<div class="crumb"><%Links::Utils::format_title($title_loop, separator => $crumb_separator, no_escape_separator => $no_escape_crumb_separator, include_home => 1, link_type => 2)%></div>

<%elseif page_id eq 'home'%>
<h2>Main Categories</h2>

<%else%>
<h2><%page_id%></h2>
<div class="crumb"><%Links::Utils::format_title($main_title_loop, separator => $crumb_separator, no_escape_separator => $no_escape_crumb_separator, include_home => 1, link_type => 2)%></div>
<%endif%>

<%if error or message~%>
<div id="contenterrors">
<%if error%><div class="error"><%error%></div><%endif%>
<%if message%><div class="message"><%message%></div><%endif%>
</div>
<%~endif%>

Where page_id is in red above, needs to be a global or some way of changing the page_id
into a Heading for that page. This would also help for internationalization as all headings
would be looked-up based on the page_id. i.e. 'add' becomes "Add a Link".

Hope this makes sense to someone.

Using the 3.2 templates i was able to 'almost' accomplish the layout I am trying to achieve.
I had to resort to setting the CSS display to 'none' for #content h2 and for .crumb .
I then added styles to 'unhide' and display them (reordered) in 'include_content_top.html'.

Although the way I am doing it (hiding in content and displaying in include_content_top) works,
there are technically 2 crumbs and 2 <h2> headings. If the CSS was missing, you will see them both Unsure

Thanks for checking this out.

Chris
RGB World, Inc. - Software &amp; Web Development.
rgbworld.com
Quote Reply
Re: [rgbworld] 3.2 template changes In reply to
Unfortunately, this is just one of those changes I can't put in because it will end up breaking everyone's templates. I will keep this in mind for the next major release and/or other products though.

Adrian
Quote Reply
Re: [brewt] 3.2 template changes In reply to
I understand.

When it comes time, you could just move the crumb and h2 into include_content_top.html.
There really isn't a need for another template.

Do you think my quick hack of hiding the crumb and h2 in #content,
and displaying them in include_content_top.html is a viable solution?
My quick hack (using 3.2 templates) can be seen in the link of prev message.

The CSS hack keeps me from having to modify ALL templates to only a handful.
That is the crumb and h2 are still in all templates, just hidden.

My concern is wrt missing CSS or page flattening (whatever you call it).
I will have duplicates crumb, h2, h2, crumb.

Should I worry about that?

Thanks again,
Chris
RGB World, Inc. - Software &amp; Web Development.
rgbworld.com