Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Hello!

I'd like to allow our client the ability to choose an existing page in the CMS to link to via an editable field. Is this something that is possible? I know it isn't asking much of the user to just type in a URL to the existing page on the site, but this totally breaks the problem that is solved by using the <cms:link /> tag (domain/host changing from dev to prod, pretty URLs on/off, etc.).

Does what I'm asking make sense? I can always elaborate if need be.

Thanks in advance!
Hi @cdunlap :)
In some certain cases, you can choose for example parent folder from a dropdown when a page is whithin folders.
What is your use-case?
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Hey there, thanks for the reply! Sorry I didn't get back to you sooner.

The use case is that I need to allow the user to link to a page that was created via a clonable template, so the URL isn't known up-front and may change if pretty URLs are enabled. I suppose I could use a related page field, but it may need to come from one of several clonable templates and therefore require several related page templates. This could also get pretty unruly if there are a lot of cloned pages (since the control used to select it is a single-select dropdown).

I just haven't found a good reliable way to do this using an editable field and that's what I'm looking for. The story would look something like the following:
1) User opens an editable page that calls for an optional link to another page
2) User clicks on a "Select Page" button (or similar), which is tied to a field in the template
3) User selects a page from a modal--perhaps filterable by name or by base template
4) User clicks OK, the template field is updated with information required to re-create a proper URL (perhaps template name and page id)
5) User resumes normal editing
Hi, looks like 'fake' relation is the way to go. I see that you probably have many templates and number of clonable pages is great, so a single dropdown is not something desirable.

So, what you probably want is to create a dynamic list of templates and clonable pages and let user see them and select the appropriate. Design choices can be multiple - rows of page titles or a modal with step-by-step selection. 'Fake' relation means that you can't use a single relation editable because it is bound to one masterpage-template, and you said you have several templates. And therefore it will be a radio/checkbox which mimics relation.

I'd use another method in such a case. Create a simple text editable and ask user paste an ID of the required linked page. With multiple templates then it will be required to indicate a template name (seelct from dropdown/radio). ID can be seen in url in various places and certain instruction can be provided as an editable type 'message' for the user or just in description beside label of the text editable. Or maybe you will explicitly show page ID on every other clonable page as an editable type message, so users can see IDs right on the page in admin. Once you have an ID saved in that text field - no problem to get the dynamic link to the page.

If you choose the modal way to show templates and then pages, then I can help you with that if you can do a working html/js design. Basically, it would mimic the nested pages hierarchical look :) Let me know.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Thanks @trendoman. I'll probably end up going down the text box page id route for now. I don't have the time required to build a full on modal or anything like that for this project. Not sure if I can log a feature request somewhere but I think this kind of thing would be pretty useful--or maybe I'm just being selfish? ;)
You are welcome to post a feature request :) viewforum.php?f=3
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
6 posts Page 1 of 1
cron