How to create an href html tag in Collective Access

Hello,

I want to create an href html tag in collective access, in order for some objects to link to an external source.

So, I want to use <a href="https://external-link" target="_blank">Hagia Triada</a>, but I noticed that target="_blank" is not working.

Is there a way to bypass this limitation ?

Thank you in advance.

Comments

  • Hi,

    It seems that some tags in links (such as "rel", "target"...) are filtered and not saved.

    When I search in the CKEditor asset (which displays us buttons in rich text editor), it seems that the filter does not come from it! So I guess this filter comes from anoter part of code in Providence...

    Seth, could you confirme that?

  • edited February 7

    I'm thinking about another way, if your links can appears in another place than in "description" field.

    For entities, objects, etc. you can add "External links" (as much as you want). So to display these links in detail pages. For exemple here in ca_entities_default_html.php file:

    {{{<ifcount code="ca_entities.external_link" min="1" max="1"><H6>External link:</H6></ifcount>}}}
    {{{<ifcount code="ca_entities.external_link" min="2"><H6>External links:</H6></ifcount>}}}
    {{{<unit relativeTo="ca_entities.external_link" delimiter="<br/>"><a href="^ca_entities.external_link.url_entry" target="_blank">^ca_entities.external_link.url_source</a></unit>}}}
    

    Here for objects in ca_objects_default_html.php file:

    {{{<ifcount code="ca_objects.external_link" min="1" max="1"><H6>External link:</H6></ifcount>}}}
    {{{<ifcount code="ca_objects.external_link" min="2"><H6>External links:</H6></ifcount>}}}
    {{{<unit relativeTo="ca_objects.external_link" delimiter="<br/>"><a href="^ca_objects.external_link.url_entry" target="_blank">^ca_objects.external_link.url_source</a></unit>}}}
    

    If you want to choose for each link if the link have to open in a new windows or not (or other HTML feature...), you can create a metadata field in the external_link container, like url_target, linked to a list that contains two value's items: 1) _self ; 2) _blank. After that, you add this metadata in the detail page. For example:

    {{{<ifcount code="ca_objects.external_link" min="1" max="1"><H6>External link:</H6></ifcount>}}}
    {{{<ifcount code="ca_objects.external_link" min="2"><H6>External links:</H6></ifcount>}}}
    {{{<unit relativeTo="ca_objects.external_link" delimiter="<br/>"><a href="^ca_objects.external_link.url_entry" target="^ca_objects.external_link.url_target">^ca_objects.external_link.url_source</a></unit>}}}
    

    😉

Sign In or Register to comment.