Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2010-09-22 11:26:38
- helmz
- Member
- Registered: 2010-09-14
- Posts: 65
My existencial and stupid question
Guys im trying to understand the Txp lang, but i just started and im lost, i read the manual and there i dont find what im searching for… well there comes my questions:
There is a think I cant catch about this cms, how i manage the articles, images, files?
i mean, if i want one big image on one side, other on other etc… how i do that? or for example if i have 5 photos using a lightbox how i do to use the images uploaded with the panel?, but the thing i realy dont understand is how to manage into article, yes i create them, and then? how i can make that a text that i put into control panel shows wherever i want?
im sorry for asking for that guys but will be just one time ;p
and thousands of thanks, im surprised with this community, its so helpfull!
regards
Offline
Re: My existencial and stupid question
Hi helmz
You need to read some articles on the wiki to have some informations about txp and how it works, another manner to understund is installing à template (from textgarden.org) that can give you some way others use txp to manage a website.
Cheers
Offline
#3 2010-09-22 11:56:49
- helmz
- Member
- Registered: 2010-09-14
- Posts: 65
Re: My existencial and stupid question
im making my own, but thats a thing i havent solved yet
Offline
Re: My existencial and stupid question
helmz wrote:
how i manage the articles, images, files?
Hi helmz. Dragondz is right that there is a bit of a learning curve and the wiki can usually help. I promise it does get easier once you get your head round it, and it doesn’t take long.
if i want one big image on one side, other on other etc… how i do that?
On a standard installation the different types of content are managed separately: you visit the corresponding admin-side tab and create articles or upload images/files. Each thing you create is assigned a unique ID. If you open up the Advanced options (in the left panel of the Write tab) you’ll see a field called Article image in which you can type the ID of an image. Once you save the article you will have associated that image with that article.
In your default
article Form (Presentation->Forms tab) you can then add the <txp:article_image />
tag somewhere within the markup and any associated image will be displayed when you view the article on your web site. If you want to display the thumbnail instead (assuming you created one when you uploaded the image) you can add the thumb="1"
attribute to that tag.
Without plugins, TXP allows you to associate one image with an article. But if you install a gallery plugin these sometimes lift the restriction and allow you to associate more using the Article image field. Alternatively you can use a custom field to hold your list of images. Each gallery plugin does things slightly differently so it’s up to you which one you prefer.
Sometimes you might find that you (or your client) don’t like having to type ID numbes into the fields so there are some image management plugins that allow you to choose images directly from the Write tab via their thumbnails and have them added to the fields on your behalf.
Plugins really open TXP up to a whole new world of functionality. For example, when the next Textpattern release becomes available I’ve written a plugin specifically for that version which allows you to create and manage multiple sizes of image — as many different sizes as you like — and use them in your site / admin panel. So you can create many different thumbnail sizes for different purposes.
how i can make that a text that i put into control panel shows wherever i want?
This is where Textbook (especially that article I linked earlier) can help. It shows the interaction between Page, Form, Style and Article. I usually use Pages to hold a common ‘look’ for a particular Section of my site and then use Forms to hold repeated bits of content that I use within the templates, e.g. a form called mast_head
which holds the markup for the site’s banner. I insert most of the forms into the template using <txp:output_form />.
When you use the special <txp:article />
tag it calls your default
Form (unless you tell it otherwise). Wherever that tag appears, one (or more) articles will be displayed. Each one will be passed through the default Form, which usually contains tags to display the article’s <txp:title/>
, its <txp:body />
text, maybe the <txp:excerpt />
and any <txp:article_image />
. Here you can put Textpattern’s tags among normal HTML markup to create the effect you want.
Hope that helps a little bit.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#5 2010-09-22 17:43:47
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: My existencial and stupid question
I think I mentioned it before, it really helps to read up on it first ;) Start here: Textpattern Quickstart: Hello World.
Edit: almost forgot we have an index page for orientation tutorials now :)
Last edited by els (2010-09-22 17:49:14)
Offline
#6 2010-09-23 09:37:00
- helmz
- Member
- Registered: 2010-09-14
- Posts: 65
Re: My existencial and stupid question
I read it, but Im stupid and I dont get it…
so, if I wanna take the images this is the way?
bc.<img src=”<txp:article_image thumb=“1”/>” height=“200px” width=“200px” alt=“image1”/>
<img src=”<txp:article_image thumb=“2”/>” height=“200px” width=“200px” alt=“image1” />
and for the articles dont know how to take the 3rd and say i want you there and the 5th and the same… ok I put it into other category, into other form, and how i unify all,
if im writting down here is cose i dont understand the wiki explanation, im sorry about, but it donts clearify my head. Thanks
Offline
Re: My existencial and stupid question
helmz wrote:
so, if I wanna take the images this is the way?
Not quite. The article_image tag renders the HTML for you, so you don’t need to add the <img>
tags yourself. Thus:
<txp:article_image thumbnail="1" />
Will show the thumbnail of the article image associated with the currently viewed article (sorry, I made a mistake earlier: the attribute is thumbnail
not thumb
). The thumbnail attribute can either be 1 — to show the thumbnail — or 0 (or omitted) to show the full size image.
and for the articles dont know how to take the 3rd and say i want you there and the 5th and the same…
If you want to specifically pick dedicated articles to display in certain positions, you use the article_custom tag. You specify the id
of the article you want to display and it’ll display it, using the default
Form to lay the relevant bits of the article out on the page. You can use a different form if you give the tag the form
attribute, or wrap your desired output between the tag’s start and end markers, like this:
<txp:article_custom id="3">
<h3><txp:title /></h3>
<p class="published"><txp:posted /></p>
<txp:body>
</txp:article_custom>
The vanilla <txp:article />
tag is always context-sensitive and will show you whichever article(s) are specified via the URL.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#8 2010-09-23 10:14:40
- helmz
- Member
- Registered: 2010-09-14
- Posts: 65
Re: My existencial and stupid question
Nice answer man finaly It worked!
This is only for articles? or can be used separately (just image)
<txp:article_image thumbnail=“1” />
Offline
Re: My existencial and stupid question
helmz wrote:
This is only for articles? or can be used separately (just image)
Yes, only for images you have put in the Article image field.
If you want to use images independently of articles you should use the image or thumbnail tags.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#10 2010-09-23 10:41:13
- helmz
- Member
- Registered: 2010-09-14
- Posts: 65
Re: My existencial and stupid question
Oh, thanks man, solved my doubts, realy, so helpful!.
Offline
#11 2010-09-23 11:39:49
- helmz
- Member
- Registered: 2010-09-14
- Posts: 65
Re: My existencial and stupid question
You can’t restore id nums? I mean, if you delete #3 and put a new one it creates it with id #4
Offline
Re: My existencial and stupid question
Hi
The id are set autoincrement in db, the onlys way to restore ID is using an sql query!
Offline
Pages: 1