Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2019-12-11 16:19:09

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

Re: Articles / snippets that have no URL + don't show in feeds

Bloke wrote #320472:

As Oleg says, with some filterAtts() tweaks, that means it’s not possible to directly – from the URL – access anything assigned to these sections. The only way to display it would be to ‘include’ it from other sections via <txp:article_custom>.

I think we would need another tag (or at least attribute) for this: <txp:article_custom /> uses filterAtts() too. Actually, you wouldn’t like your snippets be accidentally accessed via a tag used for all kind of things.

Offline

#12 2019-12-11 16:20:03

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

Re: Articles / snippets that have no URL + don't show in feeds

Bloke wrote #320472:

That won’t help you with searches. I’m not entirely sure what the search_criteria callback is for as I haven’t had much luck harnessing it in my tests here. Maybe we should add a callback that allows you to provide the same criteria to append to the search results as you do for the admin_criteria. That might be worth an extra line of code.

Check this thread. That was the tip you gave me then and it was helpful.


TXP Builders – finely-crafted code, design and txp

Offline

#13 2019-12-11 16:37:32

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,950
Website

Re: Articles / snippets that have no URL + don't show in feeds

Haha, thanks. Completely forgot about that patch to the Filter() function. I’ll apply that now. Then all we need to do is figure out the checkIfNeighbour() thing and your admin side articles can be hacked out with a few lines of plugin code.


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

#14 2019-12-11 17:01:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,950
Website

Re: Articles / snippets that have no URL + don't show in feeds

Okay, try this.

You can now restrict your articles on the admin side thusly:

if (txpinterface == 'admin') {
    register_callback('abc_hide_section', 'admin_criteria', 'list_list');
    register_callback('abc_hide_section', 'txp.article', 'neighbour.criteria');
}

function abc_hide_section($evt, $stp) {
    return " AND Section != 'snippets'";
}

So the final piece of the puzzle is the public site.


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

#15 2020-01-01 07:42:10

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

Re: Articles / snippets that have no URL + don't show in feeds

Wouldn’t it be much simpler if we had a new items tab under the Content menu and a tag like <txp:items id="1,14,5" sort="order" wraptag="" break="" class="" />? I understand that the above might have a problem with sorting but a new sort value could be added which sorts the items based on the order typed.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#16 2020-01-01 08:33:12

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

Re: Articles / snippets that have no URL + don't show in feeds

colak wrote #320777:

Wouldn’t it be much simpler if we had a new items tab under the Content menu and a tag like <txp:items id="1,14,5" sort="order" wraptag="" break="" class="" />? I understand that the above might have a problem with sorting but a new sort value could be added which sorts the items based on the order typed.

Good morning and a Happy New Year to you! Funnily enough, much of the above discussion was triggered by a suggestion I had for exactly that tag as a corresponding open ‘non-url’ content type to go alongside articles. I even looked at having a go at it as a plugin but you end up replicating a lot of the existing built-in tags that are currently hard-wired to the ‘textpattern’ table. That was my original motivation for looking at whether mck_snippets might get me there and the suggestion that Oleg and Stef came up with for using non-url or non-theme articles.


TXP Builders – finely-crafted code, design and txp

Offline

#17 2020-01-01 08:57:04

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

Re: Articles / snippets that have no URL + don't show in feeds

jakob wrote #320778:

Good morning and a Happy New Year to you! Funnily enough, much of the above discussion was triggered by a suggestion I had for exactly that tag as a corresponding open ‘non-url’ content type to go alongside articles. I even looked at having a go at it as a plugin but you end up replicating a lot of the existing built-in tags that are currently hard-wired to the ‘textpattern’ table. That was my original motivation for looking at whether mck_snippets might get me there and the suggestion that Oleg and Stef came up with for using non-url or non-theme articles.

Happy new year! I followed the discussions on both threads and contributed to them. It is just that I do not feel that articles linked to a none section, as discussed by Stef would be the right one of this type of functionality. If these items are added via the write tab, how will they be added to articles?

I would expect such items to grow to hundreds. Think of sites with many writers for example. This is where their bios could be stored unless of course another field is added in the users>authors panel… But you know what I mean:)

I would think that the items panel could be something that could be edited by people with limited permissions and it should have the same types of access as the write panel has. At the same time, these items could not be just textual. They could for example have divs (or other html or txp tags) containing images, texts, or even slight layout overrides.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#18 2020-01-01 09:00:03

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

Re: Articles / snippets that have no URL + don't show in feeds

“Great minds …” Yiannis :-) I’ve sent you a mail.


TXP Builders – finely-crafted code, design and txp

Offline

#19 2020-01-01 12:00:06

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,827
Website

Re: Articles / snippets that have no URL + don't show in feeds

colak wrote #320779:

It is just that I do not feel that articles linked to a none section, as discussed by Stef would be the right one of this type of functionality. If these items are added via the write tab, how will they be added to articles?

I would expect such items to grow to hundreds. […]

I would think that the items panel could be something that could be edited by people with limited permissions and it should have the same types of access as the write panel has. At the same time, these items could not be just textual. They could for example have divs (or other html or txp tags) containing images, texts, or even slight layout overrides.

While reading this thread following a discussion with Stef in another thread the other day, I had similar thoughts. I had and still have serious trouble picturing all this as elements / articles in a zero-URL section container.

One use case I had in mind was a message snippet (complete with HTML formatting) that occasionally appears on the site (Front page, and/or section listings page, …). It is not an article, multiple people should be able to eventually edit it and insert it. A form of include maybe ? Not sure yet how to describe it on a more abstract and general level.

Happy new year!

And a happy new year to you and all TXPers.

Offline

#20 2020-01-01 12:49:28

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

Re: Articles / snippets that have no URL + don't show in feeds

A few more thoughts after reading Julian’s email:)

Starting with the obvious. For those designers who have clients, one thing that many people need is the address and telephone numbers of their business, many times appearing in the footer.

If those clients have no access to anything else but the Content tab, they have no way of changing that information when needed unless of course it resides in an article which is the wrong thing as it will appear in the search results.

I see items as little snippets of information which needs to be repeated in a number of pages, for my site at least for things like bios, and sponsor statements. If anything needs to change, we will only need to do it once and it will repeat itself in all articles hosting the tag.

Furthemore, these items could have different permissions. ie if somebody needs changes to the layout the item tag and editing permissions could go to the designer and above, if it is an address, it could be that all writers or the author of the item have/has editing rights. As such we could have a taxonomy for this. ie <txp:item type="design" />, <txp:item type="txt" />, and others which I can not think about just now. Having said that, the design type could be partially achieved with the override_form pulldown in the write pane, the issue remaining that the particular pulldown uses a pre-decided position in the html document where these changes will occur but the item tag could give the flexibility to have that anywhere in the text. Think of adverts appearing between paragraphs for example.

In any case, the idea of items to me could develop in the same way as the idea of forms. If we think of forms like snippets of code for our pages/sections, we can think of items as snippets of whatever for the write tab, but also for limited writer based permissions in the page design (ie footer info, adverts, etc).


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

Board footer

Powered by FluxBB