Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Offline
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
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
Re: Dev news
Thanks devs, for those improvments,
The coding will be more easy with txp in some case.
Offline
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 newlink
andbreak
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
Re: Dev news
Vienuolis wrote #319825:
How about the long dreamed
txp:image
attribute linked (url)? Or even better three attributesfile
,page
, andcode
, 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
Offline
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
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
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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
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
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 ?
Sand space – admin theme for Textpattern
Offline