Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2009-08-28 04:55:47
- Yaymeq
- New Member
- Registered: 2009-08-28
- Posts: 2
layout question
Hello, I’m a complete noob to any CMS. I do understand HTML and CSS so I figure this shouldn’t be too hard but I’m very confused by a great many things. I’ve looked though the tutorials but they haven’t been much help. So my first question is, once I have an image attached to an article … how do I know where the image will show up? (Besides just viewing the site and in that case how do I change it?) I’ve looked at the css and html and I didn’t see it in there anywhere.
Right now the image is on the left of the article and that’s fine but what if I want to put a snippet of text under the image … how do I get that there too? Could I just use a caption? (What’s the caption, exactly?)
Which reminds me, where will the excerpts show up? I can’t play with it to figure it out as it’s not my site, but I told this guy I would help him … I didn’t know at the time that I was going to be dealing with a CMS … any help would be very much appreciated.
~YaymeQ
Offline
Re: layout question
Yaymeq wrote:
So my first question is, once I have an image attached to an article … how do I know where the image will show up? (Besides just viewing the site and in that case how do I change it?) I’ve looked at the css and html and I didn’t see it in there anywhere.
Right now the image is on the left of the article and that’s fine but what if I want to put a snippet of text under the image … how do I get that there too? Could I just use a caption? (What’s the caption, exactly?)
Hi Yaymeq, If you are talking a bot the article_image, it can be found on Presentation>Forms>default
. Look for <txp:article_image />
. From there you can position it in relation to <txp:body />
or <txp:excerpt />
Which reminds me, where will the excerpts show up? I can’t play with it to figure it out as it’s not my site, but I told this guy I would help him … I didn’t know at the time that I was going to be dealing with a CMS … any help would be very much appreciated.
The excerpts show up where you want them to:). As a generalised rule, they show up in article_lists. A sample code would be:
<txp:if_article_list>
<txp:permlink><txp:artcle_image /></txp:permlink>
<txp:excerpt />
<txp:else />
<!-- not in article list - individual articles -->
<txp:artcle_image /><txp:body />
</txp:if_article_list>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#3 2009-08-29 04:21:49
- Yaymeq
- New Member
- Registered: 2009-08-28
- Posts: 2
Re: layout question
Thank you Colak, so … this is that form and I dont see any css in here so could you tell me where that is?
I was also wondering if you wouldn’t mind helping me understand something about this.
<h2 class="entry-title"><txp:title /></h2>
<div class="entry-content">
<txp:variable name="has_article_image" value='<txp:article_image />' />
<txp:if_variable name="has_article_image" value="">
<txp:else />
<txp:article_image />
</txp:if_variable>
</div> <!-- EO .entry-content -->
<txp:body />
<div class="divider"><img src="<txp:site_url />/images/1.gif" width="400" height="1" alt="" /></div>
The first couple lines seem pretty self explanatory, h2 tags and divs and such.
The part that starts <txp:variable
is what’s confusing me. It looks like if statements … so in order to position it, I move all of this part
<txp:variable name="has_article_image" value='<txp:article_image />' />
<txp:if_variable name="has_article_image" value="">
<txp:else />
<txp:article_image />
</txp:if_variable>
somewhere else? Like after <txp:body />
I thought you meant to position it with CSS but now I’m not so sure since I don’t know how to edit the css. If I want to add an excerpt, do I need all those conditional statements?
More help would be even more greatly appreciated.
~YaymeQ
Offline
Re: layout question
You can replace this:
<txp:variable name="has_article_image" value='<txp:article_image />' />
<txp:if_variable name="has_article_image" value="">
<txp:else />
<txp:article_image />
</txp:if_variable>
with this:
<txp:article_image />
because if there’s no article image, <txp:article_image />
doesn’t return anything, nor does it cause an error.
On a default install Txp uses the CSS that you can find and edit in Presentation->Style. But you can use external CSS files if you prefer, and call them in the normal way in the page head
.
Here’s a very brief, off-the-cuff explanation of how Txp Pages and Forms work:
When you view a webpage in a Txp-driven website, Txp outputs everything from the Page that goes with that URL. Plain HTML and text get outputted normally, and Txp tags are replaced by the appropriate HTML and text. The final result is indistinguishable from a plain HTML file.
You can indeed simply move the Txp tags around to change the order they will appear in the final webpage. You do have to be aware that many Txp tags are containers, such as the if_variable
block you have quoted, and act as a single unit.
If there is a <txp:article />
or <txp:article_custom />
tag in the page, each article called by that tag will in turn call its assigned article form. So a form is a sort of mini-template.
Code is topiary
Offline
Pages: 1