Introduce yourself here! In order to avoid spam, new users must first comment on the discussion in the 'Introductions' before they become 'full members'
How to link to another entry?
  • Hi,



    say, i write an entry and want to link to another (older) one.
    I could just use an [url] tag with the static URL of the entry I'd like to refer to - but that would lead to deadlinks if I e.g. change the PrettyUrl settings or move my FP installation to another server or path.


    Is there a known way to link other entries dynamically, something like [entry]Title of the entry[/entry]?
    If nothing like this has done before, PHP fragments or API hints would also help.

    Thanks
    Arvid
  • I think Piero's related entries function of his tag plugin is along the lines of what you're looking for.

    Take a read of this forum post for more information on that function.

    His tag plugin is here...

    http://www.pierovdfn.it/2012/10/13/plugin-tag-v253-flatpress/

  • Hi, you can use my internal urls plugin.
    It doesn't work with titles because you can change titles but it works with entry ids.
  • pierovdfn said:

    Hi, you can use my internal urls plugin.

    It doesn't work with titles because you can change titles but it works with entry ids.


    Works fine, mille grazie :)
    Entry titles may be changed, so using the ID for sure makes sense.
    For now, I get an entry's ID by opening the entry for editing and then copy the ID from the browser url. Is there a better way?

    Oh, and the Tag plugin is something like another dimension of categorization?
  • You're welcome :-)

    I had the same problem with entry ids, so I've added this to my entry.tpl:

    {admincontrols}
    <p>ID: {$id}</p>
    {/admincontrols}

    This shows the entry id only to the administrator.
    You can put it where you want, but it must be in the entry block. I've put under the title, for example.
    You can also remove the <p> and </p>, the only importanti thing is the {$id} in the admincontrols block.


    For tags... Yes, they are like categories but tags don't replace categories.
    I wanted few categories - just 4-5 main categories, but I also wanted the possibility to link entries more precisely. For example I've the category "Information Technology" but an entry about installing Linux is very different from another one about customizing Flatpress.
    So I've created a "Linux" tag and a "Flatpress" tag. If you use tags you can also show related entries.
    However tags are less efficient than categories, because tags aren't indexed.
  • pierovdfn said:

    {admincontrols}

    <p>ID: {$id}</p>
    {/admincontrols}
    Works like a charm, thx :)

    Also thx for the detailed explanation of the tags principle. I think I will handle my current site just with categories, but for upcoming projects it's good to know what else is possible.

    Regards
    Arvid
  • sorry about this silly question but which file is meant as "entry.tpl" ...

    I had the same problem with entry ids, so I've added this to my entry.tpl:

    {admincontrols}
    <p>ID: {$id}</p>
    {/admincontrols}

    This shows the entry id only to the administrator.
    You can put it where you want, but it must be in the entry block. I've put under the title, for example.
    You can also remove the <p> and </p>, the only importanti thing is the {$id} in the admincontrols block.

    - pls can you tell me where I can find it?

    Thanks in advance!

    Regards
    Andreas
  • Hi, I'm glad you didn't open a new thread but looked for an existing one :-)

    The directory is fp-interface/themes/your-theme-id/ (for example if you use Leggero the id is "leggero").

    In my themes the file is entry.tpl but in the ones derived from Leggero the file is entry-default.tpl.

    If you can find the file please send me the theme and I will tell you the right file.
  • Hi,
    wow, what a fast response ;-))

    Thank you for the hint! Yes, the filename is entry-default.tpl in the used theme (before I didn't search in the themes directory ...).

    Congratulations to your excellent plugin internalurls which is a big improvement to Flatpress!

    Regards
    Andreas


  • Hi, thank you.
    I'm glad you have found what you looked for in our community ;-)
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion