Page urls with auto-incrementing IDs (and without Page Name parts)
By
SwimToWin, in Wishlist & Roadmap
-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By milo695
Hi all,
I need help creating link in CK editor that would target my translated page, so it depends on what language user has selected.
something like:
<a href="?id=1450">view all</a> would target:
<a href="en/onion/">Onion</a> <a href="de/zwiebel"></a> depending on user defined language.
Thank you
-
By SwimToWin
When webmaster un-globals the Title field (for instance to have a person template with first and last name), there are some unintended consequences. For a site that uses Title on 90% of templates, un-global isn't really useful because it makes adding a new page harder for novice editors:
Title field disappears from "Add New" dialog. When I "Add New" page using a template that DOES use the Title field, then the Title field is no longer shown in the Add New dialog window (in this window, an editor will enter Title and Name - and the page is then created and shown to the user in edit mode). No other "pseudo-title" fields can be added to the "Add New" dialog (and it's not possible to skip the two-step page creation process). (There is no simple way to pre-populate the Title field on templates.) Consider these flows:
When Title field is global:
Steps:
From Page Tree, press New to create a new page, "Add New" page is shown with Title and Name fields, (User may need to select Template) Enter Title (Name is automatically set), The new page is shown - start editing fields Observation: Title and Name are shown on same page (good!). Page is created with little mental effort.
When Title field is un-global and Page Template has a Title field:
Steps:
From Page Tree, press New to create a new page, "Add New" page is shown with Name field (but Title is no longer shown when template DOES have the Title field), (User may need to select Template) Enter Name, The new page is shown - start editing fields ("where am I?"). Enter Title (user no longer sees Title and Name at the same time) Observation: Redundant entries (Name and Title are often identical). Name and Title are separated across pages.
Better: Show Title and Name on "Add New" page, use Title to set Name (as when Title field is global).
When Title field is un-global and Page Template doesn't have a Title field:
Setup:
Webmaster goes to Template -> Advanced to set "List of fields to display in the admin Page List" (example: "{foo} - {bar}"). Thanks to Robins S for pointing this out. Webmaster cannot specify "Title" fields to be filled in on the "Add New" page. Steps:
From Page Tree, press New to create a new page, "Add New" page is shown with Name field, (User may need to select Template) Enter Name, The new page is shown - start editing fields ("where am I?"). Better: Setup allows webmaster to specify "Title" fields to be filled in on the "Add New" page.
Even better:
Skip the "Add New" dialog page and go directly to the resulting Title page (when only one Template can be selected).
Maybe by adding a GUID or other temporary page name that is later renamed?
Also I don't think it's possible to pre-populate the Title field in the Administration? (for details, see Pavle's comment).
See also: Creating a page without a title? (from 2012 - so I think it's OK to begin a new thread).
-
By SwimToWin
Skip the "Add New" dialog page on Page Tree and elsewhere and go directly to the resulting page that shows all page fields right away. Page creation is now improving from being a two-step to becoming a one-step process.
Scenarios:
When only one Template can be selected: Skip the intermediate "Add New" dialog page by adding a GUID or other temporary page name that is later renamed. Show the final editing page so user can start editing all fields right away On Save: Page name is renamed with title When multiple Templates can be selected: Ask user to select Template on clicking New (before leaving the Tree Page). Then use the "one Template" flow above. (I am aware why the Page Name is needed.)
-
By ridgedale
Reference: PW 3.0.111 and uikit3 based site using the Regular-Master profile.
I am trying to create a process whereby when a user logs in to their profile page (the user is automatically redirected to their profile page on login) and they then go to their 'members' page and creates a child page ('club-member'), the data stored in the user template ($user->usercode) is automatically added to the equivalent field on the club-member page. This will be applicable only to the template used for the 'club-member' pages. Once the new page has been created the equivalent 'usercode' field on the 'club-member' page should not be subsequently editable.
Below is the page hierarchy for visual reference:
Login (home)
|__ profile
|__ members
|__ club-members
It seems like an AddHookBefore might be the solution here such as:
wire()->addHookBefore("Pages::saveReady", function($event) { $page = $event->arguments(0); if($page->template == 'club-member') { $clubcode = $user->club_code; $field = $page->club_code; $field->set('value', $clubcode); } }); I am I on the right track or is there a better way to achieve this?
Any thoughts appreciated.
-
By Sten
Hello,
I still did not solve my problem about Hebrew letters. In fact, it is ok for Russian for example to have a transliteration of characters (one to one) but in languages like Hebrew, Arabic, it is better to slugify with phonetic like here :
use EasySlugger\Utf8Slugger; $slug = Utf8Slugger::slugify('日本語'); // slug = ri-ben-yu $slug = Utf8Slugger::slugify('العَرَبِيةُ'); // slug = alrbyt $slug = Utf8Slugger::slugify('עברית'); // slug = bryt So I am planning to insert https://github.com/javiereguiluz/EasySlugger
Should I create a module or just add a hook ?
I am a PW newbie.
Thanks for your help
-