custom pages app and pages with links to other pages

34 views
Skip to first unread message

Samuli Saarinen

unread,
May 3, 2024, 10:43:16 AM5/3/24
to Magnolia User Mailing List
I tried to create a custom pages app that creates pages in another workspace like described here: [1]. This worked out fine but then there are pages that have components like links that are using pages-chooser and only allow choosing pages from website-workspace. Is there some way to get pages chooser to some how use the "right" workspace based on the datasource used in my custom pages app or at least allow changing the workspace like JCR app does? I can't just override the pages-chooser workspace as I need it to work in both "vanilla" and my custom pages app.

BR, Samuli

Mykola Soldatenkov

unread,
May 3, 2024, 10:56:01 AM5/3/24
to user...@magnolia-cms.com
in 6.2 you can pick and choose datasource for the link field
if you talking about pageLinkField it is just a handy alias for regular linkField with predefined workspace: website and allowedNodeTypes: mgnl:page
source: https://git.magnolia-cms.com/projects/MODULES/repos/pages/browse/magnolia-pages-app/src/main/java/info/magnolia/pages/app/field/PageLinkFieldDefinition.java#48

you can point link field to any workspace you want
link:
  $type: linkField
  label: Link
  datasource:
    $type: jcrDatasource
    workspace: website

--
You received this message because you are subscribed to the Google Groups "Magnolia User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to user-list+...@magnolia-cms.com.
To view this discussion on the web, visit https://groups.google.com/a/magnolia-cms.com/d/msgid/user-list/b74f0363-bdc9-45a4-a433-49373b4be5ffn%40magnolia-cms.com.


--
-- 
Powyższa wiadomość wraz z ewentualnymi załącznikami jest przeznaczona wyłącznie do wiadomości osób lub podmiotów, do których jest w sposób zamierzony zaadresowana. W przypadku otrzymania powyższej wiadomości w wyniku pomyłki, prosimy o pilne powiadomienie o tym fakcie nadawcy oraz o usunięcie wiadomości z systemu, a także o nie rozpowszechnianie treści w niej zawartych. Otrzymanie powyższej wiadomości nie może stanowić podstawy do jakichkolwiek zobowiązań nadawcy tej wiadomości wobec osób nie będących jej zamierzonymi adresatami. 
This e-mail message and any attachments is intended solely for the use of the persons or entities to whom it is intentionally addressed. If you have received this message in error, please notify the sender about this fact immediately and delete it completely from your computer system. Please do not disseminate this message unless you are the intended recipient of it. This e-mail message shall not create any legal obligation on the part of the sender to persons who are not intended recipients of it.

Samuli Saarinen

unread,
May 6, 2024, 1:35:06 AM5/6/24
to Magnolia User Mailing List, Mykola Soldatenkov
Yes that much I know but it's not very convenient to make duplicates of every component with links with different references to workspaces. Not a drop in replacement either but I think for "pages app with different workspace" idea to be more useful there would have to be a custom link field that allows selecting from multiple workspaces and this would also need to be stored/encoded in the field value as well (like mycustomworkspace:/path/to/somewhere. Node uuid would work though) and be used in link rendering.

Thanks for the reply!

BR, Samuli
Reply all
Reply to author
Forward
0 new messages