Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2020-07-28 09:08:30

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,942
Website

Re: Comment Modules

bici wrote #324921:

NOTE: now that i think about it how does one output our Textpattern site as code for its various Sections Forms Pages Styles ??

If you mean from your own templates, if you’re on a 4.7+, you can go to:

  • Admin › Presentation › Themes.
  • Put a tick-mark by your theme
  • From the With selected… dropdown, choose Export to disk.

You’ll then find a folder in the /themes directory of your site on your server with all the pages, forms and styles as files.

If you mean the default template that Textpattern comes with, you can do the same as above if you haven’t modified it, or you can always find the most recent release version on GitHub.


TXP Builders – finely-crafted code, design and txp

Offline

#22 2020-07-28 09:15:32

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,942
Website

Re: Comment Modules

afoster wrote #324852:

Perhaps you can also tell me how to add a menu item next to Home/Articles in the navigation banner?

Textpattern is flexible, so you can build your own menus according to different principles. In the default template that comes with Textpattern, the menu is built from a list of sections. You can see the relevant bit of code in the body_header form (type: misc) – here it is on GitHub.

That means, if you add a new section under Presentation › Sections, a new menu item will automatically be added. Sections are a grouping mechanism, and adding a section just adds the “header” so to speak. To show articles under this heading, create a new article in Content › Write and assign it to your new section in the dropdown on the right. When you visit the front end, you’ll see it appear in your new section.


TXP Builders – finely-crafted code, design and txp

Offline

#23 2020-07-28 09:17:16

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

Re: Comment Modules

afoster wrote #324918:

I’m trying to follow the tutorial and I have reached the setting up the pages portion and this is where I am running into trouble.

Did you check out the Textpattern in two minutes document?

The contents of the zip file that bici pointed you to, is likely very out of date so I would just take the sentiment of that article and work from there.

A quick primer:

  • Sections
    Represent your site navigation structure – e.g. blog, articles, products, services, contact, and home page (called “default” in the back-end).
  • Pages
    Are blueprints that you can assign to one or more sections. They contain scaffolding such as HTML into which you wish to insert dynamic data from the database.
  • Styles
    Contain formatting rules that pretty up the pages markup. Again, assign these to one or more sections as you need.
  • Forms
    Are snippets of reusable content that you can you to save you effort. So if you want to apply the same ‘look’ to every article in a list you can set up some mini-scaffolding in a form and then in your Textpattern tags tell it to render each item in a list with that particular form. Thus if you decide later to change how you want to display your list (maybe you want to add the categories or publish date or author information or change the layout slightly) you alter it once in your form, and then your site instantly changes everywhere you’re employed that form.
  • Articles (and other content)
    These represent your site content. Each article lives in one section only. Your articles are displayed according to the page/forms/styles that you have defined for the section in which your article is written.
  • Categories
    Articles can be assigned up to two categories. These simply allow your site visitors to find collections of content that may be in more than one physical section. They act like a subset of tags. You might have sections called /recipes and /chefs. If you allow visitors to browse your categories, they could find articles ‘tagged’ with desserts that would filter out the dessert recipes and chefs who specialise in making them, presenting them in one list for easy perusal.
  • Tags
    Inside your pages/forms you put <txp:...> tags. These simple act as placeholders for dynamic content you want to inject at that point from the database. So if you want a navigation bar that shows your site sections you add <txp:section_list /> to your page template (or inside a form that you’ve included in your page) at the point you want the menu to appear. The tag’s attributes (such as wraptag and class and sections, etc) allow you to customise how the tag behaves when it fetches the content from the database.

That’s pretty much it. If you study one of the Pages and a few Forms from the default theme that’s included in Textpattern 4.8 you’ll see that there are quite a few comments sprinkled throughout. These are designed to help orient you, so take a look around to get a feel for what’s going on. Then maybe find a place in your site you want to change – perhaps the header – and alter the corresponding page. See the effect it has when you refresh the site.

Then try changing a tag or two. Mess about with a few attributes to see the effect they have. From there things should start to make a bit more sense.

Hope that helps.


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

#24 2020-07-28 15:31:56

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 1,717
Website

Re: Comment Modules

colak wrote #324927:

It worked on Safari versions 13.1.1 and 12.1.1 for me. Are you sure that you do not have a plugin messing it up?

it was not functioning on my laptop which is old. it woks on my desktop…. Safari version 12.1.2


…. texted postive

Offline

#25 2020-07-28 16:06:20

afoster
Member
Registered: 2020-07-25
Posts: 12

Re: Comment Modules

I am getting responses on this thread that have nothing to do with my problem…can someone fix this?

Offline

#26 2020-07-28 16:22:50

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

Re: Comment Modules

afoster wrote #324944:

can someone fix this?

Fix what? Do you mean:

Perhaps you can also tell me how to add a menu item next to Home/Articles in the navigation banner?

Which jakob answered.

If you mean:

How can I place a corder around the comment module that is displayed so that it sticks out more?

Then yes, as bici said, Style rules can be altered from the Presentation>Styles panel. As soon as you make changes and refresh (assuming your server isn’t caching anything – in which case, you may have to hard refresh – Shift-F5/CMD-SHIFT-R) then the changes will be reflected immediately on your site.

If you mean:

I can’t seem to grasp how this CMS works

Then I’ve tried to give you a birds’ eye view in my responses to get you oriented: a high level overview of what each component is so you can start to grasp how they fit together.

If you mean:

Could one of you refer to the tutorial and show/tell me where I went wrong?

Then I would probably not try and follow the tutorial to the letter because things have changed drastically since it was published. You’ll tie yourself in knots trying to use the zip file provided there because tags have changed and things have moved on.

The best tutorial is to install Textpattern 4.8 and step through the code in the default template (which governs what appears on the home page). Then do the same with the archive template (which governs what appears everywhere else).

By reading the comments <!-- --> in there and following through the page, matching up what you see on the front-end website with what’s in the template, you can begin to see how each piece in the page template represents something on the site.

Then it’s a case of experimenting. Add some text and see where it pops up. Change an attribute on a tag using the tag reference as a guide, and see how the output differs. Add a Section and see that it pops up in your navigation bar on the front end. Then maybe find the <txp:section_list /> tag and play with that. Add an article to the ‘Articles’ section and see that it appears on the home page and in the /articles section. And so forth.

If you install the vanilla 4.8 so we know where you are, and you get a bit lost, please ask a question or two about specific parts of the process that are confounding you and we’ll try and help out with those portions to get you on your feet.

Last edited by Bloke (2020-07-28 16:26:19)


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

#27 2020-07-28 17:04:44

afoster
Member
Registered: 2020-07-25
Posts: 12

Re: Comment Modules

My reference to “fix this” was in relation to the posts about the location of the themes page. I have been reading everyone’s response to my question and am trying to work through them.

Offline

#28 2020-07-28 17:12:46

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,942
Website

Re: Comment Modules

afoster wrote #324944:

I am getting responses on this thread that have nothing to do with my problem…can someone fix this?

Hi, as Bloke and bici have mentioned, the tutorial is from 2009 so Textpattern (and the web) have developed quite a bit since then. I downloaded the files from that page (which unfortunately don’t quite match the description in the text) and updated them for Textpattern version 4.8 for you:

You can download that as a theme called PoulinPortfolio here.

To install that:

  1. Download the zip and unzip it on your computer
  2. Copy the folder called “PoulinPortfolio” (pls don’t rename it for now) to the /themes directory in your Textpattern installation.
  3. Now in your Textpattern admin area, visit Presentation › Themes. At the top you should now see “Import from Disk: PoulinPortfolio”. Click Import.
  4. You’ll now have an entry under Themes for PoulinPortfolio.
  5. To apply the theme to your site – or to individual sections of your site – visit Presentation › Sections and either visit each section you have created one by one and assign the theme “PoulinPortfolio” and the respective “Page template” (as per the tutorial) and the Style to “screen”. You can also do that for several at once by using the tick marks in the list and then the dropdown at the bottom to apply themes, sections and styles to multiple sections in one go.

Differences to the tutorial:

  • By importing the theme I’ve supplied, you don’t need to copy and paste any of the templates or forms. You also don’t need to assign them to the respective form types (that’s already done). Textpattern’s theming system (which wasn’t available at the time of the tutorial, keeps themes separate, so you don’t need to overwrite any of your own templates).
  • You don’t need to install any of the plugins mentioned (I changed the templates to use built-in textpattern tags), except … (rvm_if_this_article -> txp:if_article_id, and upm_article_image -> txp:images / txp:image, ebl_img_edit used flash and is no longer available).
  • If you wish to create a contact form, like in the tutorial, you should use “com_connect” which you can download here. It works in exactly the same way but uses the tag com_connect instead of zem_contact (see notes here).
  • Some of the forms mentioned in the tutorial weren’t actually in the download. I’ve done a best-guess at what they could have contained.

General notes:

To see something with the template, you do, of course, have to create some articles and images (at the specified sizes) and assign them to the respective articles. The tutorial describes that, also that you need to make a sticky article for the intro text (I put that in the about section). I tried it out quickly and it does still work.

The templates Marie Poulin are quite bare bones and are designed to illustrate the principles. I’ve tried to change as little as possible. It does mean some things are hard-coded (like copyright message, menu sections etc.) and it’s not responsive. That means you must supply images in the correct sizes or the layout will break. Nowadays you’d do that differently using css flexbox or css grid. If you want to use my test images (simple flat-colour and labelled images), you can download them here.

Screenshots: Homepage, About, Work, Work item.


TXP Builders – finely-crafted code, design and txp

Offline

#29 2020-07-28 17:51:42

afoster
Member
Registered: 2020-07-25
Posts: 12

Re: Comment Modules

Jakob, thank you so much for your response and after reading through it I believe I will be better off starting from scratch and importing the theme you attached to your response. Otherwise I would have to back and undo all the changes I did by using the tutorial from 2009. I will check back if/when I need additional help.

First question…in looking at the screenshots you provided, how/where would I place the image at the top of the homepage. I have an image that fits the size needed but have not been able to get it to display. For that matter, I have not been able to display the homepage.

Second question…I have been able to remove the webpage information from the contact form. I would like the Name and Email labels and text boxes to appear in two columns…can you point me in the right direction for that?

Last edited by afoster (2020-07-28 22:10:12)

Offline

#30 2020-07-29 16:39:48

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,294
Website

Re: Comment Modules

afoster wrote #324954:

First question…in looking at the screenshots you provided, how/where would I place the image at the top of the homepage. I have an image that fits the size needed but have not been able to get it to display. For that matter, I have not been able to display the homepage.

Can you post some of the page code you are trying?

Second question…I have been able to remove the webpage information from the contact form. I would like the Name and Email labels and text boxes to appear in two columns…can you point me in the right direction for that?

You can place each of those fields in a divs and give those divs a max-50% width and appropriate styling (ie width:49%; margin-right: 1%; float:left;), although Jakob and other people here may suggest a more modern way of doing it:)


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

Board footer

Powered by FluxBB