Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2019-10-22 16:13:16

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 270
Website GitHub GitLab Twitter

Re: Dev news

Thank you for these useful improvements. How about the long dreamed txp:image attribute linked (url)? Or even better three attributes file, page, and code, mentioned in 2017, 2013

Offline

#14 2019-10-22 19:46:07

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,172
Website

Re: Dev news

Hi Vienuolis,

If it’s of any use to you, there is my jcr_image_custom that adds a custom field to the image edit pane and a tag to display it. It only does one custom field but can be modified for several custom fields if need be. It’s heavily based on wet_profile (link in the credits on GitHub) which shows an example for two additional custom fields for the author panel. I made similar plugins for links and files too but haven’t publicised them much, mainly because when textpattern’s in-built custom fields come, my plugins can be retired.
It doesn’t deal with the article image case, but someone gave you a straightforward solution to that in the thread you linked to using a parallel custom field.


TXP Builders – finely-crafted code, design and txp

Offline

#15 2019-10-22 19:55:13

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,172
Website

Re: Dev news

michaelkpate wrote #319820:

And I think all of these are things that could be useful.

Absolutely! You keep finding subtle ways to make our tools more versatile!


TXP Builders – finely-crafted code, design and txp

Offline

#16 2019-10-23 07:11:40

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,430
Website GitHub Twitter

Re: Dev news

Thanks devs, for those improvments,

The coding will be more easy with txp in some case.

Offline

#17 2019-10-23 07:36:31

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,483
Website GitHub Twitter

Re: Dev news

etc wrote #319819:

If you don’t need all the bells and whistles^1^ of etc_pagination, this commit empowers <txp:newer|older /> tags with pagination bar abilities. You can easily construct basic navigation blocks like

First page ... Page 4 Page 5 Page 6 ... Last page...

via already existing but undocumented shift attribute and new link and break attributes.

1 subliminal advertisement

Really? I can’t beleive it! 😲
Thank you lot!


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#18 2019-10-23 07:59:58

etc
Developer
Registered: 2010-11-11
Posts: 4,512
Website GitHub

Re: Dev news

Vienuolis wrote #319825:

How about the long dreamed txp:image attribute linked (url)? Or even better three attributes file, page, and code, mentioned in 2017, 2013

These are custom fields, and our cf model is not yet fixed. We wouldn’t like to introduce something that will be broken in the next release. So I fear this will not be for 2019, sorry.

jakob wrote #319828:

You keep finding subtle ways to make our tools more versatile!

Thanks! Hope “versatile” is not synonym of “bloated” :-)

Dragondz wrote #319835:

The coding will be more easy with txp in some case.

Pat64 wrote #319836:

Really? I can’t beleive it! 😲

I hope so!

Offline

#19 2019-10-30 16:01:56

etc
Developer
Registered: 2010-11-11
Posts: 4,512
Website GitHub

Re: Dev news

michaelkpate wrote #319820:

That is something I have wanted for, oh, about, 15 years.

Dunno why you wanted it, but per section permlink modes are there. Please test it thoroughly, that was not a few-liner.

Offline

#20 2019-10-31 16:12:52

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,371
Website GitHub Mastodon

Re: Dev news

etc wrote #319876:

Dunno why you wanted it, but per section permlink modes are there. Please test it thoroughly, that was not a few-liner.

I remember discussing permalinks with Dean once but I can’t find the thread. This is from June 2004.

jennycheuk wrote #13300:

Is it possible now to get rid of the article number automatically when publish ?

Eventually we did. (I can’t find when that was).

Then we had wnp_clean_site and zem_rewrite and sgb_url_handler and mic_permlink and my personal favorite, gbp_permanent_links, which many people are still using (not necessarily with the latest version though).

Here’s an example: Design a blog with permalinks in the format /year/month/day/title. Then add a contact page and an about page by creating sections using /section/title. I used to do that in gpb_permanent_links a lot.

Offline

#21 2019-10-31 20:01:20

etc
Developer
Registered: 2010-11-11
Posts: 4,512
Website GitHub

Re: Dev news

michaelkpate wrote #319880:

Here’s an example: Design a blog with permalinks in the format /year/month/day/title. Then add a contact page and an about page by creating sections using /section/title. I used to do that in gpb_permanent_links a lot.

Plugins approach was (and still is) fine, but txp custom fields branch is taking shape, and it will be quite possible for articles from different sections to have different structure (e.g. no title or category at all). So introducing per section permlink mode in core seems justified, though it’s too early for custom modes yet.

Offline

#22 2019-10-31 20:08:57

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,724
Website GitHub Twitter

Re: Dev news

Hi Michael,
I guess that the latest dev will offer you at least part of what you are describing with the inclusion of categories and sub-categories in the url schema. I agree that we may never have the flexibility of gbp_permanent_links, but we will still have enough flexibility to do what we need, be it in a more manual way. We can for example name sections like 2019, 2020, 2021 etc, then create 12 categories, one of each month and then categories for the days of the months. `Tedious but possibly doable.

My one confusion for now is whereas breadcrumb/title/ will by default pick category_1 and if there will be a semantic role for category_2 within this schema.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#23 2019-10-31 20:30:49

etc
Developer
Registered: 2010-11-11
Posts: 4,512
Website GitHub

Re: Dev news

You can already use year/month/day/title mode in one section, and section/title in another one. Just note that authors, categories etc are not tied to sections, so their permlinks will follow the default format set by the global permlink_mode pref.

colak wrote #319882:

My one confusion for now is whereas breadcrumb/title/ will by default pick category_1 and if there will be a semantic role for category_2 within this schema.

It will pick both and go to the maximal depth. For example, if cats is a descendant subcategory of animals, an article with Category1="animals" and Category2="cats" will have a rather verbose

section/animals/mammals/.../cats/title

permlink. Which also means that just cats would suffice here.

Note that section/category/title mode produces a shorter permlink, skipping intermediate nodes:

section/animals/cats/title

Offline

#24 2019-11-01 01:50:36

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,470
Website

Re: Dev news

Yay! Now that you have started implementing it, I’m actually looking forward to this (esp section/category/title). But…

In debug mode, I get this on the section-edit panel. Not intended I supposed although my cat looked up…

Notice "Undefined variable: sec_permlink_mode"
in /Users/<username>/Sites/_txptest/textpattern/include/txp_section.php at line 524.

textpattern/include/txp_section.php:524 adminErrorHandler()
textpattern/include/txp_section.php:59 section_edit()
textpattern/index.php:261 include()

but then, changing the URL pattern to section_category_title and saving returns an error:

The section was not saved due to an error. Please try again.

Debug message again:

User_Error "Unknown column 'permlink_mode' in 'field list'"
in /Users/<username>/Sites/_txptes/textpattern/lib/txplib_db.php at line 403.

adminErrorHandler()
textpattern/lib/txplib_db.php:403 trigger_error()
textpattern/lib/txplib_db.php:453 safe_query()
textpattern/include/txp_section.php:645 safe_update()
textpattern/include/txp_section.php:59 section_save()
textpattern/index.php:261 include()

When accessing the front end, accessing a section (article list) is OK but an individual article returns a 404, with

General error Notice: Undefined index: development on line 404
textpattern/publish.php:237 preText()
index.php:107 include()

development is the section title for the page in this case.

the (default) URL pattern is section/title


Where is that emoji for a solar powered submarine when you need it ?

Offline

Board footer

Powered by FluxBB