Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-05-02 23:14:02

robpenfold
New Member
Registered: 2019-05-02
Posts: 5

Tweak for a WordPress refugee

I have used WordPress a little but have never really taken to it and then stumbled upon TextPattern and really like its speed.
What I would like to do – and this would probably be simple for someone who knows what they are doing* – is have the TP version behave the same way as the WP blog – ie the home page has a list of posts with excepts and then clicking on a post title gives you a page devoted to that one post

https://llicit.com/
https://llicit.com/tp

Happy to pay for the advice etc

Thanks Rob

  • Have read the various documentation but for some reason can’t quite get the TP approach as yet – a video on how to construct a website would be very helpful

Offline

#2 2019-05-03 05:31:20

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,058
Website GitHub Mastodon Twitter

Re: Tweak for a WordPress refugee

Hi Rob and welcome to txp.

the home page has a list of posts with excepts and then clicking on a post title gives you a page devoted to that one post

The default template installed by txp works exactly like how you describe.


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 2019-05-03 05:50:30

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Tweak for a WordPress refugee

colak wrote #317869:

The default template installed by txp works exactly like how you describe.

The default template shows the whole article on homepage (excluding comments), not the excerpt. WordPress default is to have excerpts on homepage and you click through to full article.

This can easily be done in Textpattern though. I’m sure someone can show you the code you need (sorry, I would but I’m on my smartphone right now).

Offline

#4 2019-05-03 06:01:16

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,058
Website GitHub Mastodon Twitter

Re: Tweak for a WordPress refugee

Whoops! you are absolutely right. I did not do a clean install for some time.

Here’s how to do it

Go to Presentation>Pages>default

Search for

<!-- else is this the front page? -->
                    <txp:if_variable name="front-page">
                        <!-- links by default to form: 'default.txp' unless you specify a different form -->
                        <txp:article limit="5" />

replace with

<!-- else is this the front page? -->
                    <txp:if_variable name="front-page">
                        <!-- links by default to form: 'default.txp' unless you specify a different form -->
                        <txp:article limit="5" form=""><txp:excerpt/></txp:article>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2019-05-03 09:13:48

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Tweak for a WordPress refugee

Hi robpenfold,

My suggestion would be as follows (slightly different to Colak’s).

In the default page template, change everything between the <main> tags from:

           <!-- Main content -->
            <main aria-label="<txp:text item="main_content" />" itemscope itemtype="https://schema.org/Blog">

                <!-- is this the search result page? also omits the pagination links below (uses pagination format within search_display.txp instead) -->
                <txp:if_search>
                    <txp:output_form form="search_display" />

                <txp:else />
                    <!-- else is this the front page? -->
                    <txp:if_variable name="front-page">
                        <!-- links by default to form: 'default.txp' unless you specify a different form -->
                        <txp:article limit="5" />

                    <txp:else />
                        <!-- else is this an article author list? -->
                        <txp:if_author>
                            <h1 itemprop="name"><txp:text item="author" /> <txp:author /></h1>

                        <txp:else />
                            <!-- else is this an article category list? -->
                            <txp:if_category>
                                <h1 itemprop="name"><txp:text item="category" /> <txp:category title /></h1>
                            </txp:if_category>
                        </txp:if_author>
                        <txp:article form="article_listing" limit="10" wraptag="ul" class="article-list" />
                    </txp:if_variable>

                    <!-- add pagination links to foot of front page/author listings/category listings if there are more articles available -->
                    <txp:evaluate test="newer,older">
                        <nav class="paginator" aria-label="<txp:text item="page_nav" />">
                            <txp:newer rel="prev">
                                <txp:text item="newer" />
                            </txp:newer>
                            <txp:older rel="next">
                                <txp:text item="older" />
                            </txp:older>
                        </nav>
                    </txp:evaluate>
                </txp:if_search>

            </main>

To:

            <!-- Main content -->
            <main aria-label="<txp:text item="main_content" />" itemscope itemtype="https://schema.org/Blog">

                <!-- is this the search result page? also omits the pagination links below (uses pagination format within search_display.txp instead) -->
                <txp:if_search>
                    <txp:output_form form="search_display" />

                <txp:else />
                    <!-- else is this the front page? -->
                    <txp:if_variable name="front-page">
                        <h1>Latest</h1>

                    <txp:else />
                        <!-- else is this an article author list? -->
                        <txp:if_author>
                            <h1 itemprop="name"><txp:text item="author" /> <txp:author /></h1>

                        <txp:else />
                            <!-- else is this an article category list? -->
                            <txp:if_category>
                                <h1 itemprop="name"><txp:text item="category" /> <txp:category title /></h1>
                            </txp:if_category>
                        </txp:if_author>
                    </txp:if_variable>

                    <txp:article class="article-list" form="article_listing" limit="10" wraptag="ul" />

                    <!-- add pagination links to foot of front page/author listings/category listings if there are more articles available -->
                    <txp:evaluate test="newer,older">
                        <nav class="paginator" aria-label="<txp:text item="page_nav" />">
                            <txp:newer rel="prev">
                                <txp:text item="newer" />
                            </txp:newer>
                            <txp:older rel="next">
                                <txp:text item="older" />
                            </txp:older>
                        </nav>
                    </txp:evaluate>
                </txp:if_search>

            </main>

This provides article title, article except (if available, otherwise omits) and link through to full article, directly on the homepage.

Offline

#6 2019-05-03 10:38:57

robpenfold
New Member
Registered: 2019-05-02
Posts: 5

Re: Tweak for a WordPress refugee

Thank you all for those suggestions. Packing for a weekend away but will try those on return

ta, Rob

Offline

Board footer

Powered by FluxBB