Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
In a quagmire of problems, how can I get out of this mess?
Greetings Guys,
I’ve been gradually developing a custom layout as I’m testing my new TXP install. As such, I’ve been implementing different ‘bits & pieces’ of functionality to my layout. However, now that I’m close to completion, I’ve seem to have outwitted myself.
Basically, my site structure is as such: Default page consists of a photo gallery slideshow, which is linked to a – gallery – section [smd_gallery’s working great magic here], a ‘recent articles’ listing, that picks content from a section – blog – which has 3 content categories, and ‘top-5’ article listings in each of the content category, and a ‘discussion forums topics’ [TXPhorum is working, albeit needs some ‘sprucing’]. Article page consists of basically of ‘content display’ forms.
Generally, my implementation is divided into three sections, Blog [where all articles are], Gallery [where all photos are], Members [access to discussion forums].
My problems:
Articles – on home page, article lists are showing superbly, however, when clicked, the page looses all formatting, despite being linked to the proper CSS, and still shows other content from the ‘default’ [home] page. Where could I be going wrong?
On default page I’m using <txp:article_custom section="2-blog" limit="5" form="featured" />
for article listing.
On articles page I’m using <txp:article section="<txp:section>" limit="10" listform="featured" form="single_article" />
for both article listing and display.
For the gallery…how can I include code that will enable me to call the gallery form on the above[articles] page?
Any comments, input, advise, or walk-throughs will be greatly appreciated….
Que,
Que-Multimedia
Offline
Re: In a quagmire of problems, how can I get out of this mess?
Difficult to tell exactly where the problem regarding css lies but one thing I see immediately:
txp:article (not _custom) is context sensitive, which means you don’t need to specify a section – it will use the one you are currently in (in the URL) so all you need is <txp:article limit="10" listform="featured" form="single_article" />
for your section page template.
Aside: Also (although you don’t need it here) note that in your example your notation is wrong: <txp:section />
must be written with a closing /tag and also if you want a tag to be processed inside another tag you need to enclose it in single apostrophe’s, e.g. <txp:example-tag ... section='<txp:section />' ...>
(4.07 upwards).
Are you using different page templates for your sections and your default page? That’s the easiest way to make sure they behave differently. If you use the same template you can use <txp:if_section name="default"> ... <txp:else /> ... <txp:if_section>
to make the front page and section pages perform differently (note for 4.08 that may have to read <txp:section name=""> ...
(see here).
Afterthough on CSS: How are you calling CSS? If using txp:css
check that you have the correct css selected for your respective sections in the “sections” tab. If you are referencing them directly as files, check you have used an absolute path beginning with href="/rest-of-path"
. If you are missing the leading slash, it may be expecting to find the css at /section/your-css-file.css
instead of at the root. You can use the firebug plugin for firefox to root out why certain files/images are not being found.
TXP Builders – finely-crafted code, design and txp
Offline
Re: In a quagmire of problems, how can I get out of this mess?
Jakob,
Thank you for your prompt response. Well, the CSS is not the problem. All pages are accessing the CSS file [calling it using <txp:css n="structure" format="link" media="all" />
, which is same for the page templates.
I’m using two different page templates, i.e. ‘default’, and ‘articles’, whereby the default page is basically a collection of various summaries [i.e. I have a gallery slide show, a discussion forum list, and article lists for the different categories in the www.sitename.com/blog section], and the articles page is basically a ‘content list’ [as shown by listform="featured"
], and ‘individual page’[as shown by form="single_article"
] view of relevant content.
The problem I’m experiencing is that, content in the sectional pages is not displaying as required, and looses formatting [i.e. when I click on an article link from the default [home] page, the content shows, albeit looses formatting, whilst other page items [i.e. header, navigation, and footer] show as desired [thus eliminating CSS error]. When I click on a ‘category’ link from the ‘default’ page, the content shows, albeit looses formatting, and, displays together with other ‘default’ page items [i.e. the slideshow, the Discussion Forums list e.t.c] despite being a category under the -www.mysite.com/blog-section. Where could I be going wrong?
Que,
Que-Multimedia
Offline
Re: In a quagmire of problems, how can I get out of this mess?
Sounds as though your sections are using the default page. You set the page for each section in Presentation->Sections. You have to do this one section at a time, saving the changes for each section separately.
Code is topiary
Offline
Re: In a quagmire of problems, how can I get out of this mess?
did that already, however still getting the same problem. All my other pages are set to use the page ‘articles’.
Que,
Que-Multimedia
Offline
#6 2009-01-08 16:08:52
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: In a quagmire of problems, how can I get out of this mess?
Can you post a tag trace (explanation at the bottom of this FAQ page) of such a problem page?
Offline
Re: In a quagmire of problems, how can I get out of this mess?
Again, difficult to tell without being able to take a look. Guesses:
content in the sectional pages is not displaying as required
Can you elaborate? What is being shown and what should be being shown?
… and looses formatting …
Compare the source HTML structure of both page outputs. Are they different? Are you missing an HTML item (for example a content container div or something) that you’ve specified in the CSS? Are your CSS declarations too specific so that they only apply on the startpage, e.g. body#default #content p?
Again, the firebug plugin for firefox helps you quickly see which css declarations are being applied or overridden.
When I click on a ‘category’ link from the ‘default’ page, the content shows, albeit looses formatting, and, displays together with other ‘default’ page items
If you are using txp:article_custom
as you suggest on the default page, that is NOT context-sensitive so it won’t detect if you are on a category page or not. For this you need to explicitly say what should happen if you are on a category page. Solution: Add an <txp:if_category> ...[ <txp:else /> ]... <txp:if_category>
to your page template.
If on the other hand you would rather have the categories appear on a section page (using the other section template that uses the normal context-sensitive txp:article
), you need to make sure that your links to the category also include the relevant section, i.e. look like /my-section/?c=category
. If you are using txp:category_list
to automatically generate a list of links to categories output your links, add the attribute section="my-section"
to your tag to make it output the section too.
TXP Builders – finely-crafted code, design and txp
Offline
Re: In a quagmire of problems, how can I get out of this mess?
Well, trying all this out, possibly, I may have to go through the ‘page’ code slowly.
Que,
Que-Multimedia
Offline
Re: In a quagmire of problems, how can I get out of this mess?
Jakob, Els,
Probably, posting the ‘page’ code here might help identify the problem, and sort it out quicker, as such, my ‘default’ page code follows, all your ideas are welcomed.
Que
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><txp:page_title /></title>
<txp:rvm_css n="960" format="link" media="all" />
<txp:rvm_css n="structure" format="link" media="all" />
<txp:rvm_css n="html" format="link" media="all" />
<txp:rvm_css n="text" format="link" media="all" />
<txp:rvm_css n="reset" format="link" media="all" />
<link rel="home" href="<txp:site_url />" />
<txp:feed_link flavor="atom" format="link" label="Atom" />
<txp:feed_link flavor="rss" format="link" label="RSS" />
<txp:rsd />
<!-- Begin Featured Gallery Scripts -->
<link rel="stylesheet" href="css/jd.css" type="text/css" media="screen" charset="utf-8">
<script type="text/javascript" src="jsf/mootools.js" ></script>
<script type="text/javascript" src="jsf/jd.js"></script>
<script type="text/javascript" src="jsf/jd_002.js"></script>
<script type="text/javascript" src="jsf/transitions.js"></script>
<!-- End Featured Gallery Scripts -->
</head>
<body>
<div class="container_12">
<div class="col_tt">
<div class="headertitle" onClick="top.location.href='<txp:site_url />';">
<span title="Link to Home" onmouseover="this.style.color='white';" onmouseout="this.style.color='#80C31C';">
<txp:site_name />
</span>
<span class="headertitlesmall">
- africaanimal.org
</span>
</div>
<div class="headersubtitle">
<txp:site_slogan />
</div>
</div>
<!-- end .col_tt -->
<div class="col_ttb">
<!-- Site Search Form -->
</div>
<!-- end .col_ttb -->
<div class="grid_12">
<!-- Site-Wide Navigation - By Section -->
<div class="container">
<txp:section_list break="li" wraptag="ul" class="miniflex" active_class="active" />
</div>
</div>
<!-- end .grid_12 -->
<div class="clear"> </div>
<div class="grid_4">
<div class="col_tt">
<!-- Sub Navigation - By Category -->
<div class="listmenu">
<h3 class="listheaderbar"><txp:section link="1" title="1" /></h3>
<txp:category_list break="li" wraptag="ul" active_class="active" />
</div>
</div>
<!-- end .col_tt -->
<div class="col_ttb">
<!-- Some Ad-Space -->
</div>
<!-- end .col_ttb -->
<div class="clear"> </div>
<div class="col_a">
<div class="member_login">
<h3>Member Login</h3>
<txp:ign_if_logged_in privs="0,1,2,3,4,5,6">
<div class="login_info">
<ul>
<li><span><strong>Welcome, <txp:ign_user_info type="realname"/></strong></span></li>
<li><span>You are logged in with the username: <strong><txp:ign_user_info type="name"/></strong></span></li>
<li><txp:ign_logout_link return_path="<txp:site_url />"> Text for the logout link </txp:ign_logout_link></li>
</ul>
</div>
<txp:else />
<txp:ign_show_login />
</txp:ign_if_logged_in>
</div>
</div>
<!-- end .col_a -->
<div class="col_b">
<div class="polls">
<h3>Polls</h3>
<!-- Poll Results Displayed -->
</div>
</div>
<!-- end .col_b -->
<div class="clear"> </div>
<div class="full_c">
<!-- Archives Calendar -->
<div class="calendar">
<h3>Calendar</h3>
<txp:mdp_calendar_small section="2-blog" />
</div>
</div>
<!-- end .full_c -->
<div class="clear"> </div>
<div class="full_c">
<div class="partner_list">
<h3>Collaborators</h3>
<!-- List of Links -->
</div>
</div>
<!-- end .full_c -->
</div>
<!-- end .grid_4 -->
<div class="grid_8">
<txp:if_section name="1-about, 2-blog">
<div class="clear"> </div>
<div class="full_c" id="recent_list">
<txp:article limit="10" listform="featured" form="single_article" />
</div>
<!-- end .full_c -->
<txp:else />
<div class="clear"> </div>
<!-- begin .full_c -->
<!-- Begin Gallery Slideshow -->
<div class="full_c">
<style>
#myGallery, #myGallerySet, #flickrGallery {
width: 605px;
height: 400px;
/*z-index:5;*/
border: 1px solid #000;
}
.myGallery, .myGallerySet, .flickrGallery {
width: 100%;
height: 400px;
/*z-index:5;*/
border: 1px solid #000;
}
.jdGallery .slideInfoZone
{
position: absolute;
z-index: 10;
width: 100%;
margin: 0px;
left: 0;
bottom: 0;
height: 85px;
background: #000;
color: #fff;
text-indent: 0;
overflow: hidden;
}
</style>
<script type="text/javascript">
function startGallery() {
var myGallery = new gallery($('myGallery'), {
timed: true,
defaultTransition: "fadeslideleft"
});
}
window.onDomReady(startGallery);
</script>
<div class="content">
<div id="myGallery">
<txp:smd_gallery category="Gallery" limit="10" sort="date desc">
<div class="imageElement">
<h3>{alt}</h3>
<p>{title}</p>
<a href="some-section/some-page?pic={url}" title="open image" class="open"></a>
<img src="{url}" class="full" />
<img src="{thumburl}" class="thumbnail" />
</div>
</txp:smd_gallery>
</div>
</div>
</div>
<!-- End Gallery Slideshow -->
<!-- end .full_c -->
<div class="clear"> </div>
<div class="full_c" id="recent_list">
<txp:article_custom section="2-blog" limit="5" form="featured" />
</div>
<!-- end .full_c -->
<div class="clear"> </div>
<div class="col_a" id="forums">
<div class="forum_list">
<h3>Discussion Forums</h3>
<txp:article_custom limit="5" section="discussions" sort="posted desc">
<h4><txp:permlink><txp:title /></txp:permlink></h4>
</txp:article_custom>
</div>
</div>
<!-- end .col_a -->
<div class="col_b" id="popular_list">
<div class="popular_list">
<h3>Popular Categories</h3>
<txp:arc_popular_category_cloud weighted="1" break="," minfont="50%" maxfont="120%" />
</div>
</div>
<!-- end .col_b -->
</txp:if_section>
<div class="clear"> </div>
<div class="col_a">
<div class="col_a">
<div class="section_archive">
<h3>Environment</h3>
<txp:article_custom section="2-blog" category="Environment" limit="5" offset="5">
<h4>» <txp:permlink><txp:title /></txp:permlink></h4>
</txp:article_custom>
</div>
</div>
<!-- end .col_a -->
<div class="col_b">
<div class="section_archive">
<h3>Health & Wellness</h3>
<txp:article_custom section="2-blog" category="Health-Wellness" limit="5" offset="5">
<h4>» <txp:permlink><txp:title /></txp:permlink></h4>
</txp:article_custom>
</div>
</div>
<!-- end .col_b -->
</div>
<!-- end .col_a -->
<div class="col_b">
<div class="col_a">
<div class="section_archive">
<h3>Science & Technology</h3>
<txp:article_custom section="2-blog" category="Science-Technology" limit="5" offset="5">
<h4>» <txp:permlink><txp:title /></txp:permlink></h4>
</txp:article_custom>
</div>
</div>
<!-- end .col_a -->
<div class="col_b">
<div class="section_archive">
<h3>Society & Culture</h3>
<txp:article_custom section="2-blog" category="Society-Culture" limit="5" offset="5">
<h4>» <txp:permlink><txp:title /></txp:permlink></h4>
</txp:article_custom>
</div>
</div>
<!-- end .col_b -->
</div>
<!-- end .col_b -->
</div>
<!-- end .grid_8 -->
<div class="clear"> </div>
</div>
<!-- end .container_12 -->
</body>
</html>
Que,
Que-Multimedia
Offline
Re: In a quagmire of problems, how can I get out of this mess?
It would still help us greatly to know what you’re trying to solve and what is not working properly, i.e. what is being shown and what should be being shown? We have the haystack but which needle are we supposed to be looking for? :-)
So, some further guesses:
1) First of all: in an earlier post you said you had different page templates for the homepage and the sections. In your code you have a <txp:if_section name="1-about, 2-blog">
in this template but this won’t be processed if you’ve assigned a different page template to the sections “1-about” and “2-blog”. If you want this code to be applied for those sections, check that you have assigned the “default” page template to the sections “1-about” and “2-blog”.
2) Regarding css try replacing href="css/jd.css"
with either href="/css/jd.css"
(with leading slash) or href="<txp:site_url />css/jd.css"
. The same goes for the javascript directly beneath it. If you are in a section it will be looking for your-domain.com/section-name/css/jd.css rather than your-domain.com/css/jd.cs. e.g.
<!-- Begin Featured Gallery Scripts -->
<link rel="stylesheet" href="<txp:site_url />css/jd.css" type="text/css" media="screen" charset="utf-8">
<script type="text/javascript" src="<txp:site_url />jsf/mootools.js" ></script>
<script type="text/javascript" src="<txp:site_url />jsf/jd.js"></script>
<script type="text/javascript" src="<txp:site_url />jsf/jd_002.js"></script>
<script type="text/javascript" src="<txp:site_url />jsf/transitions.js"></script>
3) In your section_archive divs is your use of offset="5"
intentional? This will skip the first five articles so that you see articles 6-10 in each of the categories.
<txp:article_custom section="2-blog" category="Environment" limit="5" offset="5">
4) this bit of code for the article_custom links in your section-archive divs also suggest that the categories apply to articles in the section 2-blog. At present your category list opens them on the default page. Add the attribute section="2-blog"
to your category_list tag to make the category links open in that section:
<!-- Sub Navigation - By Category -->
...
<txp:category_list section="2-blog" break="li" wraptag="ul" active_class="active" />
BTW 1,2 and 4 I had already suggested trying in previous posts – it helps if you try out the suggestions we make.
TXP Builders – finely-crafted code, design and txp
Offline
Re: In a quagmire of problems, how can I get out of this mess?
Greetings Jakob,
Well, to answer a number of your questions…
1. Yes I use different pages for the different sections, however, when I click on any of the links on the content-list on the ‘default’ [home] page, the content ends up showing within the ‘default’ [home] page, unless I type the section name in the browser url [e.g. http://localhost/txptest/2-blog], hence ‘messing’ up the layout.
2. The CSS you’re referring to is meant to show on the ‘default’ [home] page only, as it is the only page that is using the ‘slideshow’ for the images, in the ‘gallery’ page, I use a different ‘presentation’ [form]. However, I’m considering using your method, to have ‘fault-proof’ links to the CSS files.
3. Yep, the offset is intentional. This is to avoid ‘repetition’ since the main ‘article list’ picks articles from the various categories, whilst these pick from specific ‘blog section’ article ‘categories’.
4. This is meant to be a ‘sub navigation’ pane, which should display the available categories. [i.e. if I’m on the ’2-blog’ section, here I should only see the relevant categories, otherwise on the ‘default’ page, I should see all available categories, which, when clicked, should go to their appropriate ‘article lists’]
Well, I hope this demystifys what I’m trying to achieve, and hope that this eases up the search. Hopefully, we’ll all find the same needle.
Cheers
Que
Que,
Que-Multimedia
Offline
Re: In a quagmire of problems, how can I get out of this mess?
1. It sounds like your articles are not assigned to a section in the write pane. As soon as they are txp:permlink
will link to them in the appropriate section. If they are already assigned to a section, check that you are using txp:permlink to link to them.
Once the articles are assigned to a section (in the write tab), the page template you have assigned to that section (in the sections tab in the admin area) will come into effect for them and the if_section parts of the default page template won’t be used.
2. Yes, good practice anyway.
3. fine, but note that if your main listing shows let’s say the last 10 most recent articles from all categories, that doesn’t necessarily mean that the first five of each category will be among those 10.
4. txp:category_list has a this_section="1"
attribute that will link to the currently active section.
TXP Builders – finely-crafted code, design and txp
Offline