Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2020-01-17 22:50:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,131
Website

Re: Integrate Textpattern in existing site

Yep, exactly. Make your ‘default’ Page template a copy of the above. Just replace:

<?php include... ?>

with:

<txp:php> include...</txp:php>

And then in your <div> page content </div> put a <txp:article /> tag with suitable parameters to display your list of blog articles. They should be automatically clickable using the default Form content and each link will lead to its individual article. If not you can use it as a container tag and/or employ some conditional logic such as: <txp:if_article_list> ... <txp:else /> ... </txp:if_article_list> to branch based on whether the URL represents a list or an article.

You might want to set your permlink scheme to just ‘/title’ from Admin->Preferences, unless you plan on having different sections to your blog.

EDIT: Haha, Oleg and Jools were quicker than me :)

Last edited by Bloke (2020-01-17 22:55:52)


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

#12 2020-01-17 22:53:07

etc
Developer
Registered: 2010-11-11
Posts: 3,580
Website

Re: Integrate Textpattern in existing site

jakob wrote #321211:

Hehe, Oleg was quicker and more succinct (as ever)._

The more the merrier :-)

Offline

#13 2020-01-21 14:53:11

blogling
Member
Registered: 2020-01-16
Posts: 12

Re: Integrate Textpattern in existing site

Ok, step by step I am starting to get the hang of it. Thanks for all your wise messages.

I am still trying to eliminate all the built in css but that will be sorted as well. External phps so far are running well.

A few things where I would be happy to be pointed to the correct references (I somehow have not figured out the documentation logic yet):

1. At the top of the page I currently have “Home” and “Articles” links. Where can I remove “Articles”?

2. How can I limit the number of articles on a page before the user should click “page 2” or whatever?

3. I would like to show only one or two paragraphs and then have a “more” link so people can read the full article if desired. Is there an existing command for this?

3. Textpattern has sections and inside articles it has categories. My general article structure will be:

A. For professionals
B. For consumers
C. Products

Inside consumers will be

1. Country information + subcategories (UK, Spain, France, etc.)
2. How-to hands on tips

How shall I manage this? With sections or categories?

And where can visitors to the page select from such lists (also when the page is viewed on mobile).

Any links would be helpful.

Thanks for your kind assistance

blogling

Offline

#14 2020-01-21 15:37:02

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,776
Website

Re: Integrate Textpattern in existing site

Hi responses in between

Ok, step by step I am starting to get the hang of it. Thanks for all your wise messages.

I am still trying to eliminate all the built in css but that will be sorted as well. External phps so far are running well.

You could create a form without any css and then call that one.

1. At the top of the page I currently have “Home” and “Articles” links. Where can I remove “Articles”?

In Presentation>Forms>body_header there is

<txp:section_list default_title='<txp:text item="home" />' include_default wraptag="ul" break="">

Change that to

<txp:section_list default_title='<txp:text item="home" />' include_default exclude="articles,other-section,etc" wraptag="ul" break="">

2. How can I limit the number of articles on a page before the user should click “page 2” or whatever?

in the default install search for txp:article limit="5". Change the limit to your desired one.

3. I would like to show only one or two paragraphs and then have a “more” link so people can read the full article if desired. Is there an existing command for this?

You need <txp:excerpt /> but you will also need something like <h2><a rel="canonical" href="<txp:permlink />"><txp:title /></a></h2> which links to the title of the article.

3. Textpattern has sections and inside articles it has categories. My general article structure will be:

A. For professionals
B. For consumers
C. Products

Inside consumers will be

1. Country information + subcategories (UK, Spain, France, etc.)
2. How-to hands on tips

How shall I manage this? With sections or categories?

And where can visitors to the page select from such lists (also when the page is viewed on mobile).

Any links would be helpful.

Thanks for your kind assistance

As from the latest dev version this is very doable not only for the screen but also in the way that it will be reflected in the urls. If for example you have 3 sections called

  • For professionals
  • For consumers
  • Products

You can then create categories such as UK, Spain, France and the urls will become

site.tld/for-proffessionals/uk/

This will of course be an article list with all the articles under the particular section and category. Is this what you are looking for? If so, here is the current, yet to go live, work I am doing for one of my sites, which hopefully it will be of help to you.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#15 2020-02-14 11:47:54

blogling
Member
Registered: 2020-01-16
Posts: 12

Re: Integrate Textpattern in existing site

Thank you Yiannis, today I am back at Textpattern. Your guidance is valuable.

Offline

Board footer

Powered by FluxBB