Add a link generated by shortcode to a column

Hi there,

I have a dynamic link that is generated using a shortcode (something like this “[editlink label=“Edit” page_id=113]”) and I’d like to add it to a column, so that when you click the column, you are taken to the link generated by the shortcode.

Setting the column to an <a> HTML tag and adding the shortcode to the Link --> URL field obviously doesn’t work.

Any other suggestions for how to do this?

Hello @detailsguy,

Thanks for writing in!

Please be advised that you can only use the shortcode [editlink label=“Edit” page_id=113] as your column link if it will output an absolute or relative URL. If ever the shortcode will output an HTML link, you cannot use it in the Column element setting as a link.

Best Regards.

Thanks for the quick response!

I figured that was the case but thought I’d check.

In the past, ThemeCo support has suggested that I wrap a column element in a link using jQuery, something like: jQuery("#column-id").wrap("<a href='https://example.com' target='blank'></a>");. but I don’t believe that will work either in this case when combined with php/shortcode.

Do you have any suggestions for another workaround that would allow me to use this shortcode to turn that column into a link?

Hi @detailsguy,

If I have understood your point correctly, you are trying to convert the Column element into a Link. If that is the case, you can select a as the HTML tag from the Column element and add the link, as shown in the given screenshot.

Thanks

Unfortunately per my notes above, that won’t work in this situation as it is a dynamic link generated by the following shortcode: [editlink label=“Edit” page_id=113] which outputs links similar to this: https://example.com/update-information/?frm_action=edit&entry=17

So I’m wondering about a possible workaround.

Hi @detailsguy,

In that case, there is nothing we can do about this and unfortunately, there is no alternative solution too.

Thanks

Ok, I’ll sort it out, thanks anyway.

Hi @detailsguy,

Great and you’re welcome! If you have any other concerns or clarifications regarding our theme features, feel free to open up a new thread.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.