Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#41 2020-09-06 15:04:23

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

Re: Tag for static section on homepage only

gu wrote #325813:

Thank you for your reply Yiannis, which I am grateful for as a form of encouragement. Above all, thank you for your time and input. I wanted to stop by to say that before getting back to working on the site. Have a lovely day!

One good way of designing with txp is to do it without fluff. That is, use as few html elements as possible and no css. Once you know that the tags work as intended in the pages you wish them to appear, you can start adding the rest. In other words, do your app first and then work on the user interface.


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

#42 2020-09-06 15:49:21

gu
Member
Registered: 2020-08-27
Posts: 44

Re: Tag for static section on homepage only

Thank you Yiannis – I am on that very wavelength and have deleted things. Also, I am making progress!

I see I made many errors in my second to last post… I am tempted to correct it but above all want to say: thanks for the encouragement. A little wind for the solitary sail (not so solitary!)


<!— space for hope —>

Offline

#43 2020-09-06 21:41:41

gu
Member
Registered: 2020-08-27
Posts: 44

Re: Tag for static section on homepage only

>major edit follows, throughout post as I thought I had questions, but then found I was able to answer them myself, largely thanks to the input in this thread which I have revisited multiple times.

This post was once about making it to debug mode once I was sure, based on double-checking the advice here and on the tag explanations, that what I wrote was based on support.

I had a problem with <txp:article_custom frontpage=“1” sort=“Section desc” /> which got the warning Closing tag without corresponding opening tag: </txp:if_individual_article>.

I had problems caused by div class with txp combos. <txp:search_input /> appeared as a ‘form not found’ though it was on the page.

Output forms are magic. Thanks to Yiannis for continuing to recommend them – that must have been lodged in my brain to help associate the forms with these problems, even though I began by pursuing solutions based on wraptags, thinking the problem was caused by html class divs.

In conclusion, I do not think that I know how to use forums. It is too tempting for a person like me to think aloud and, in this instance, not be able to judge where or what is deemed useful to say because I am just so new at both forums and coding (to be fair, I did a little bit a while ago, but there are different levels of beginners). I can’t wait to get over this beginner’s slump but thank you for contributing to what is a safe community to grow. If I succeed in growing, you will be the village that raised me :)

I would really like to clean up previous comments, but maybe they are a source of fond memories for some as they remember their own first steps, or a prompt for a gentle chortle. But if anyone thinks I could scrap some of them to tidy up this thread I would be more than happy to. I cannot believe how even I myself can see just how messy they are in such a short time (though inclusive of both nights and days). I hope to have my little program to share soon, but I am not quite done. Cheers to this most lovely forum.

Last edited by gu (2020-09-07 10:32:57)


<!— space for hope —>

Offline

#44 2020-09-07 11:14:23

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,349
Website

Re: Tag for static section on homepage only

I rarely reply re technical things on this forum, usually leaving it to those who are very clear about tags and coding, but maybe others are very busy so I’ll have a go, gu, and hope I don’t confuse you.

gu wrote #325824:

I had a problem with <txp:article_custom frontpage=“1” sort=“Section desc” /> which got the warning Closing tag without corresponding opening tag: </txp:if_individual_article>.

<txp:if_individual_article> ends with </txp:if_individual_article> and the warning simply states either <txp:if_individual_article> is missing, or perhaps you spelt it wrong or there’s an extra > or something like that.

I had problems caused by div class with txp combos. <txp:search_input /> appeared as a ‘form not found’ though it was on the page.

Perhaps you had <txp:search_input /> on the page, but does it exist in your list of forms? Have you changed its name, perhaps to search-input or something like that?

In conclusion, I do not think that I know how to use forums….

You’re doing fine, don’t worry about it, we all make mistakes and say things that embarrass us later that we wish we’d never said. But at the time we didn’t know as much as we know now, or perhaps we weren’t having a good day. We’re all human beings on here (except developers who are super-human pretending to be quite normal :) so we’ve all been through stuff similar to your experience. I’m looking forward to seeing your little project, it sounds intriguing.


Wondrous Healing Wondrous ways to a healthy old age
Safe Reiki Harmless natural healing.
Gud One Blog

Offline

#45 2020-09-07 13:00:56

gu
Member
Registered: 2020-08-27
Posts: 44

Re: Tag for static section on homepage only

Hi Zero, so appreciate your message! Truly!!!

In the mean time, here is some news: I can’t believe it but I finished my little site! No more bugs!

Since I have found WC3 markup validation to kind of be like a Magic 8 Ball: sometimes revealing new problems simply by entering the website address at a different time of the day, I will let the site rest and then recheck it. Then I’ll try to check for redundancies. And then I’ll share it.

I am reading the Themes: Creating, Using, Sharing page now and expect that will be a learning process too but I hope to have this out by next week.

Thank you for being so supportive of “beginner’s mode” :)


<!— space for hope —>

Offline

#46 2020-09-07 14:35:21

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

Re: Tag for static section on homepage only

Hi, gu. Your journey here in the forum is important to keep as documentation, and as an aid to help others learn. I’ve been here nearly fifteen years and posted a ‘problem’ just yesterday that I couldn’t fathom, only to find the answer obvious when someone pointed out that I was using the wrong version of Textpattern that was too old for the feature I was trying to implement! Happens to us all, so don’t worry.

That said – and I don’t want to patronize you or anything here so please forgive me if it comes across that way – here are a few general Textpattern tips that might help in your orientation:

Textpattern ‘list’ tags that operate to display collections of context-aware things (articles, images, categories, sections, files, comments, and so forth) can be used in three fundamental ways:

1) As a container – a pair of opening and closing tags:

<txp:some_list_tag wraptag="div" class="my-wrapper">
   Display <txp:dynamic_facets /> of <txp:each_thing /> in the collection.
   This allows you to customise how the content of each item is laid out.
   The entire set will be wrapped in <div class="my-wrapper">list of things</div> as dictated by the tag's attributes.
</txp:some_list_tag>

(<txp:dynamic_facets /> and <txp:each_thing /> aren’t real tags, they’re just to show that you can put <txp:> tags in to display dynamic information from the database/content anywhere you like)

2) As a single self-closing tag with the form attribute:

<txp:some_list_tag form="reuse_me" wraptag="div" class="my-wrapper" />

The entire set of items will be wrapped in <div class="my-wrapper">list of things</div> as indicated by the list tag’s attributes.

Then, in Presentation>Forms, create a form (of any type) called reuse_me with tags and content such as this, that you wish to display for each item:

Display <txp:dynamic_facets /> of <txp:each_thing /> in the collection.
This also allows you to customise how the content of each item is laid out.
The same Form can be reused for other tags so it's easier to manage in future.
Change your layout or content in the form and your site updates automatically wherever this form is used.

3) As a single self-closing tag without the form attribute:

<txp:some_list_tag wraptag="div" class="my-wrapper" />

This will operate exactly as in (2) but it will use a pre-defined form name. In the case of articles, this will be one called default. So if you modify that form, you change how every article tag that uses it behaves.

So any time you want to override the default behaviour of some ‘list’ tag, you specify a form attribute so the tag will display the content in that form when your page is displayed and it encounters that tag. This concept follows in some other non-list tags too. In the case of <txp:search_input />, for example, it looks for a corresponding search_input form. If that form doesn’t exist, the tag will throw a warning (in debugging mode).

Some tags don’t accept form because they output a specific piece of information. The <txp:title /> tag, for example, will only output the article title of the current article indicated by the visitor’s /section/some-article URL. Or, if used in a form or container, the article title of each item in the collection.

So when you’re debugging a Textpattern page, you need to be mindful of how a tag is being used.

If it’s a ‘single’ (self-closing) tag, it’ll output the given context-aware content when the tag is encountered as the page is displayed.

If it’s a self-closing ‘list’ style tag and has not been given a form it will use a default form to display content for each item in the collection. The default form that will be used in each case are all mentioned in the tag docs.

If it’s a self-closing ‘list’ style tag and has been given a form, it will use that form for each item in the collection. It’s up to you to ensure that form exists and uses relevant tags for the context in which the form is used.

If the ‘list’ style tag is used as a container, then the content between the opening and closing tags will determine how each item in the collection is displayed. It’s up to you, again, to use relevant tags for the context. So, for example, if you’re displaying a list of site sections:

<txp:section_list wraptag="nav" class="site-sections">
   <a href="/<txp:section />"><txp:section title /></a>
</txp:section_list>

Is perfectly valid (although you can do the same thing with a simple self-closing tag in this case, since that’s the output the tag creates by default). But you cannot use, say, <txp:title /> in that container, because Textpattern is in “section list” context at that moment and has no idea what ‘article title’ means.

In short, be aware of context and which forms are being used for what. If I ever get stuck and not sure which form is being used, I’ll type some random text string into the top of the form I think should be in use, save it and refresh the page. If that text appears on the page, the form is in use. I can then delete the text string safe in the knowledge that the form I’m working on is the one being used in that context. This practice, although old-skool, is still quite handy, and comes into its own when you’re messing around with themes and need to be sure that the form you’re working is the one in the theme you expect.

Hope that helps.

Last edited by Bloke (2020-09-07 14:38:43)


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

#47 2020-09-07 17:33:01

gu
Member
Registered: 2020-08-27
Posts: 44

Re: Tag for static section on homepage only

Dear Bloke, receiving a gem like that is certainly worth making public my waffling; I write half in jest :)

In all seriousness, I have come across your contributions here on the forum and to key textpattern github material while reading up on txp and I’d like to say what a special forum this is when experts like you also stop by and help beginners with their first steps.

Thank you so much for sharing that lesson!


<!— space for hope —>

Offline

#48 2020-09-09 14:37:29

gu
Member
Registered: 2020-08-27
Posts: 44

Re: Tag for static section on homepage only

>Update: It is now in order and images of sample pages have been added to the wiki. The ‘about’ blurb contains thanks to the forum (thanks is also included in the code). I know it is a simple project, but you were all such help. Thank you again.

Here is a link to the very simple theme I built on the Zero install: https://github.com/temene/tem. The branches are not yet in order but I just wanted to stop by because it is ‘live’.
If I have made any mistakes, I would be so appreciative if you would let me know.
Thank you so much to all of you for your assistance. Please let me know if I can be of help in any way. On my end, I will be spreading the word of textpattern!

Last edited by gu (2020-09-10 18:21:58)


<!— space for hope —>

Offline

#49 2020-09-10 18:38:32

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,349
Website

Re: Tag for static section on homepage only

Well, it’s certainly minimal! I noticed one or two things ~

The front page shows categories and this is the only navigation to articles, except for Search which might bring up an article in its results.

But when viewed on a narrower viewport, Search disappears as does the site name too.

You have this in your stylesheet page:

<div class="box">
<div>
<txp:link_to_home><txp:image id="2" /></txp:link_to_home>
</div>

<div>
<txp:link_to_home>
<txp:site_name float="center" />
</txp:link_to_home>
</div>

<div class="push">
<txp:output_form form="search_input" />
</div>
</div>	 

<txp:site_name /> cannot have a float="center" It is also an invalid css rule (unless it has become part of the flex css of which I know nothing). Consequently the site name and Search are positioned to the right of the image. I think you probably want to do something like this instead:

<div class="box">
<div>
<txp:link_to_home><txp:image id="2" /><br /><txp:site_name /></txp:link_to_home>
<txp:search_input />
</div>
</div>

Congratulations on creating the most minimal Textpattern site I’ve ever seen!

Last edited by zero (2020-09-10 19:12:12)


Wondrous Healing Wondrous ways to a healthy old age
Safe Reiki Harmless natural healing.
Gud One Blog

Offline

#50 2020-09-10 19:23:39

gu
Member
Registered: 2020-08-27
Posts: 44

Re: Tag for static section on homepage only

>edited to include the another key reason I chose Textpattern

Hi Zero! I smiled so much when I read your comment about the site being minimalist! I know – and also, it was my goal :) cf. building what we want, just the way we want it…

But to advertise why I chose Textpattern for this: while my ‘design’ (if we may be generous towards me for a moment) may be minimal, it is taking full advantage of inherent capacities to TXP (e.g. interlinking, the potential for multiple authors – and also because, unlike a wiki, one can change the interface: also, I will possibly change some things to cater to user vision once they join. Textpattern affords such flexibility as opposed to the readymade).

Actually, I realise I have a question: is there a max number of users on Textpattern? What happens if they all contribute at the same time?

To return to your comment about the code, yes my CSS includes flex. Also, about the narrow viewport, the CSS should take care of that, too. But I only tested it on devices I had on hand…

The “page” was such as I tried to follow the instructions on how to submit a theme. But it is possible that I did not understand.

Dear Zero, thank you for writing. I know that my project is super simple (and think I have stated that from the start) but I hope you are not disappointed! …at least amused :) Greetings!

Last edited by gu (2020-09-10 19:50:04)


<!— space for hope —>

Offline

Board footer

Powered by FluxBB