Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-05-02 07:21:53
- evilhomer201
- New Member
- Registered: 2006-05-02
- Posts: 8
How do I get articles to display in places other than the index.php
Hi there,
I am having trouble getting my articles to display outside of the main index.php file.
Under Presentation > default template… I editted the code to show the design of my current site.
http://employeeswanted.com/mockup/CMS
The problem is, I can get stuff to show up on that link just fine using:
txp:article_custom form=“Single” category=“General” section=“article” sortby=“Posted” sortdir=“desc” listform=“Single”
I would like to be able to use the links to the left (ie ‘Phoenix’, Tucson, etc.) to load a drop down which will then load a
article_custom form based on the category selected in the drop-down.
Is this possible, and what do I need to do to accomplish this so that my visitors can come to http://employeeswanted.com/mockup/CMS, then click on a city, and select a category from the drop down, which will then display the articles like they were displayed on http://employeeswanted.com/mockup/CMS … Of course, I also only want specific articles to show up hence the category=“General” section=“article” in the txp:article_custom form…
Thank you ahead of time and I hope I can get this to work using this CMS, I’ve been dying to use something like this for awhile, and it’ll make my job so much easier.
Last edited by evilhomer201 (2006-05-02 08:13:00)
Offline
#2 2006-05-02 19:57:39
- evilhomer201
- New Member
- Registered: 2006-05-02
- Posts: 8
Re: How do I get articles to display in places other than the index.php
bump … Am I an idiot, and this isn’t possible?
Offline
#3 2006-05-02 20:27:33
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How do I get articles to display in places other than the index.php
No you are not, and yes it is, but you are asking a lot in one post ;)
To display articles in one category:
<code>
<txp:if_category>
<txp:article form=“this” listform=“that” limit=“nn” />
</txp:if_category>
</code>
You can make a link to a category page like this: <txp:category name="phoenix" title="1" link="1" />
.
If you want the list of categories in your sidebar as a dropdown menu you can use <txp:category_list />
, but I’m not sure if that is what you meant.
Have a look at the tags I mentioned to see how they can be used here.
Offline
Re: How do I get articles to display in places other than the index.php
hi evilhomer201
I dont understand exactly what you want… but…
index.php is just a file that call some functions to output your page templates (Prestentation -> Pages)
You dont need to create any other file, you dont have to duplicate index.php, you dont have to mess with files in TXP…
You simple go and create sections (in Presentation -> Sections) and configure them to use different page templates that you have previously created in Presentation -> Pages and use different CSS created in Presentation -> Styles
It’s that easy…
TXP works as an stand-alone web-application…
Please, check the FAQs and the manual
Offline
#5 2006-05-02 22:11:48
- evilhomer201
- New Member
- Registered: 2006-05-02
- Posts: 8
Re: How do I get articles to display in places other than the index.php
maniqui wrote:
hi evilhomer201
I dont understand exactly what you want… but…
index.php is just a file that call some functions to output your page templates (Prestentation -> Pages)
You dont need to create any other file, you dont have to duplicate index.php, you dont have to mess with files in TXP…
You simple go and create sections (in Presentation -> Sections) and configure them to use different page templates that you have previously created in Presentation -> Pages and use different CSS created in Presentation -> Styles
It’s that easy…
TXP works as an stand-alone web-application…
Please, check the FAQs and the manual
Are the page template in Presentation -> Pages copies of default… I’ve tried creating pages and putting in the txp:article_custom parameters, but nothing comes up…
Last edited by evilhomer201 (2006-05-02 22:12:16)
Offline
#6 2006-05-02 22:26:05
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How do I get articles to display in places other than the index.php
evilhomer201 wrote:
Are the page template in Presentation -> Pages copies of default… I’ve tried creating pages and putting in the txp:article_custom parameters, but nothing comes up…
Are you saying that you copied the default page template to php pages? Don’t do that, there are no actual pages in Textpattern, everything is stored in the database and is called onto the page depending on what tags you put there.
Did you create categories ‘Phoenix’, ‘Tucson’, etcetera? If not, then do so, assign the right category to your articles, and put <txp:if_category>
</txp:if_category>
around the article tag that’s in the default page template. Put <txp:category_list />
in the sidebar to create a dropdown menu, or create your links like this: <txp:category name="Tucson" title="1" link="1" />
, etc. And see what happens.
Also read this, it will explain how Textpattern works.
Last edited by els (2006-05-02 22:28:00)
Offline
Re: How do I get articles to display in places other than the index.php
Are the page template in Presentation -> Pages copies of default… I’ve tried creating pages and putting in the txp:article_custom parameters, but nothing comes up…
No, it doesnt work that way. Did you take a look to any of the resources I gave to you? :D
To be more specific, I recommend you to read the followings:
Have fun…
Offline
#8 2006-05-02 22:27:53
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: How do I get articles to display in places other than the index.php
It sounds like you’re overcomplicating things. Start here. You probably don’t need multiple templates, and article_custom probably isn’t the right tag for the job – see here.
For the navigation part, see here, particularly the bit about the category popup list.
The default page template that comes with Textpattern already works in a similar manner to what you’re describing. Perhaps not exactly the same, your description isn’t clear, but you should take a look at the way it works.
Last edited by zem (2006-05-02 22:29:39)
Alex
Offline
#9 2006-05-02 22:29:42
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How do I get articles to display in places other than the index.php
Well if this won’t help him on his way ;) (sorry Maniquí, I’m not doing it on purpose…)
Offline
#10 2006-05-02 23:00:33
- evilhomer201
- New Member
- Registered: 2006-05-02
- Posts: 8
Re: How do I get articles to display in places other than the index.php
Els wrote:
evilhomer201 wrote:
Are the page template in Presentation -> Pages copies of default… I’ve tried creating pages and putting in the txp:article_custom parameters, but nothing comes up…
Are you saying that you copied the default page template to php pages? Don’t do that, there are no actual pages in Textpattern, everything is stored in the database and is called onto the page depending on what tags you put there.
Did you create categories ‘Phoenix’, ‘Tucson’, etcetera? If not, then do so, assign the right category to your articles, and put <txp:if_category>
</txp:if_category>
around the article tag that’s in the default page template. Put <txp:category_list />
in the sidebar to create a dropdown menu, or create your links like this: <txp:category name="Tucson" title="1" link="1" />
, etc. And see what happens.
Also read this, it will explain how Textpattern works.
Oh, well my articles are in the categories of “General”, “Sales”, “Automotive” instead of the cities. (they’re employment sections in various publications throughout the west coast, hence the Phoenix, Tucson, Los Angeles, etc.)
Is there a way to have links listed like a navigation (instead of a drop down) and when you click the link (say, Phoenix)… a drop-down appears which has the categories for “Phoenix-only” articles. I have Link Categories for the various cities under Content -> Organize already.
It seems to me that I’m really close, I’m just not thinking about it right.
I’m sorry this is so confusing, it’s hard to explain what I see in my head :-)
Offline
#11 2006-05-02 23:17:39
- evilhomer201
- New Member
- Registered: 2006-05-02
- Posts: 8
Re: How do I get articles to display in places other than the index.php
When I use the txp:if_category tags around txp:article form=“default” listform=“default”, it’s trying to direct me to http://employeeswanted.com/mockup/CMS/category/General/ …. but nothing displays, eventhough I have articles in a category called General
Offline
#12 2006-05-02 23:56:59
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: How do I get articles to display in places other than the index.php
Please be clear in your descriptions: “directing me to”, “nothing displays” are ambiguous.
Alex
Offline