Search

I am experimenting with Symphony and so far I really like it. However, I am running into trouble trying a fairly basic thing (I think). I need to add Related Links to some of my pages. These links would basically have a title and an address, and there could be many of them for any given page. I think I could do this sort of backward, by creating a Related Links section, and referencing my Pages as parents, but is there a way to be able to add a Related Link to the parent Page from the parent?

Thanks for reading.

Currently the closest thing to what you want would be using Associations Interface (allows you to create new relationships/entries)

To a certain extend it's still a work in progress as at this point it doesn't allow you to add existing or search. But I believe it won't be too long till someone extends its functionality.

If the Related Links are unique to each page and there's no need for a reverse connection (e.g. you have an 'Articles' section and you just want to add 1 or more Related Links to random external URLs) you might also want to look at the Dynamic Text Group extension. It allows you to add an arbitrary number of custom text fields to an entry - an example would be adding Track listings to a Album entry/section, every album has a different number of Tracks. Likewise you could add a Related Links group that allows you to add Title & URL combos to each entry.

Have attached a screenshot to show it action.

Not sure if this is what you had in mind, but thought worth a mention in case it helps.

Attachments:
dynamic-text-group.jpg

The Pages Field now also allows the same associations logic too.

I never thought about adding existing entries to be honest. I think however that it would be out of scope for the abilities of the current codebase.

Thank you all for your responses!

@gunglien - what is the Associations Interface? Is it an extension?

@firegoby - thank you very much for this suggestion. I saw this extension listed but I didn't know you could have multiple fields per line and I saw it wasn't compatible with 2.3.3 so I didn't get in too deep. Your screenshot encouraged me to look at the development branch which is at least beta-compatible with 2.3.3. This may not be my final solution, but it is much better than what I was thinking! I have a follow up question, though. Say I have Related Links in a couple of categories that will be grouped together on display: Technical, FAQs, and Projects. Do you have any thoughts on whether it would be better to add a Group field to my single dynamic text group, or would I be better off creating three separate dynamic text groups, one for each category (assuming the categories are static)?

@designermonkey - I found the Pages Field extension in the listing. Is that something that I can set up a Data Source for, or does it just pull Page names? Also, I cannot tell from the documentation and discussion I have found, can you have a dynamic number of this type of field? Or, say, if I am using the Dynamic Text Group extension and I install the Pages Field extension, would the page select box be available in the dynamic text group?

Again, thank you all for reading and for your quick responses :)

@gunglien - what is the Associations Interface? Is it an extension?

This is something new in Symphony 2.3.3, basically allows you to see all linked entities on the right hand side of an entry. It also has a button create new so you could create a new link.

At this point it does not have an add existing button however an extension in the future (if not the core itself) could provide the functionality

I found the Pages Field extension in the listing. Is that something that I can set up a Data Source for, or does it just pull Page names?

It is a type of field which pulls the page names and allows you to link your entries to pages. Obviously in your datasource you can then output this selectbox value or filter using the same value.

Or, say, if I am using the Dynamic Text Group extension and I install the Pages Field extension, would the page select box be available in the dynamic text group?

Not as far as I know, the Dynamic Text Group extension has a predefined list of thins it offers, obviously I would think it could potentially be extended. When needed I've extended it to cater for other fields such as multilingual (requires php knowledge / feature request).

Yes sorry I should have noted you'd need the Development branch (often times do when using extensions on newly released Symphony versions). There's also seems to be a couple of bugs with the extension under 2.3.3 from my quick playing around with it, for example you're meant to be able to resize the width of the fields in the Section editor but I can't seem to. Also I found when editing the section, one time it screwed up the display of my example dynamic text group and I had to delete the whole DTG field and start again. Both these bugs seem to be related to the UI component (rather than the PHP/Database code).

From a very quick look at the console in Chrome, when you try to resize the fields there's an error in jquery-ui-1.8.16 so perhaps updating the JQuery UI library dependencies would fix this? Perhaps Sym 2.3.3 is using a newer version of JQuery (2.0? branch) and the old JQuery UI isn't compatible?

The other bug I can't seem to recreate right now so don't know what that might be. (There's reference to it on the Github issues list I see though, with potential fix by editing the DB onetime?).

For handling multiple types I would recommend using a select dropdown in one Related Links field - see attached screenshot. (Also there's an outstanding issue on Github that says you can't use multiple dynamic text groups in one section? - and from my very quick play this morning seems as though that's still true - so that would nix the multiple options from the start.)

Attachments:
related-links-example.jpg

Quick Update: Just tried updating the JQuery UI library to v1.10.3 and the field resizing is working again under Symphony 2.3.3 - well mostly, it's a little glitchy in that the far right hand side field doesn't anchor/tether itself to the end of the row, but with a little playing around you can get it to do what you need, see attached, updated screenshot of Album Track listing with variable width fields.

Still can't recreate the other bug so not sure what causes that, or even if you'd be affected by it.

Attachments:
resize-field-widths.jpg

I've made a fork on Github with a branch dev-firegoby that updates JQuery UI to v1.10.3 which makes the drag-width stuff work again (see above). Also added a line or two of CSS so that on the Publish page there are little 'drag handles' to highlight the fact that entries can be drag-dropped to order them. Have attached screenshot showing how it looks now on Sym 2.3.3

Attachments:
dev-firegoby-dtg.png

@gunglien - Thank you for your responses. I don't mean to be obtuse, perhaps it is just too late in the day... I have 2.3.3 but I can't find anything called "Associations" or any mention of it anywhere... Where is this? I think the Page Field would not work for me because I need to link to "pages" that are not Pages (if that makes sense). I mean I have pages being created dynamically from entries in a section, and from what I am understanding from your comment, it would not be possible (currently) for me to populate this list with those dynamic "pages"?

@firegoby - Above and beyond the call of duty here firegoby, I really appreciate the help in understanding how to approach this problem with Dynamic Text Group. Thank you very much.

To activate associations, you will need to use the Selectbox Link field to link two sections together. Once that's done, a button appears within the edit/new screens for entries in those sections. Bear in mind that the correct way to link entries is to have the Selectbox Link in the child section, linking to the parent.

@designermonkey - Aha! Thank you! It makes so much sense now. I hate when someone is being helpful and I'm just missing it...

Thank you all for your answers, now I just need to poke around with Associations and the Dynamic Text Group and figure out which works best for this particular situation. Essentially just need to decide if the user should be able to control the display order or if my data source should.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details