Announcement

Collapse
No announcement yet.

Can u help me create a visible link to click with placeholder in it?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can u help me create a visible link to click with placeholder in it?

    Hi guys
    I would like to ask, if someone figured out , how to create a custom button or link, where part of it on the end will be placeholder which will replace when the link activated with actual name from the record where its stored.
    Lets say this is my case:

    https://www.northdata.com/{Lead.name}

    If i would Click on this link, browser would be looking for exact link as mention above, but if my company is called in CRM - lets say ,,ATEST", i want browser to look for

    https://www.northdata.com/atest

    I tried URL, Button, Varchar field, WYSIWYG fields, but it doesnt work anywhere.
    Does someone know?

  • #2
    You have to fill the wysiwyg field or the link button with the formula in the backend in the desired entity.
    It doesn't work just like that.

    Comment


    • #3
      Here is the link to a thread discussing the Link Button extension: https://forum.espocrm.com/forum/exte...on-link-button
      Last edited by shalmaxb; 10-03-2024, 04:44 PM.

      Comment


      • MONBERG
        MONBERG commented
        Editing a comment
        Yes i use this extension already, but as i put link with PLACEHOLDER in it, it doesnt react. But you caught my attention with wysiwyg field, i never used that before, but could you maybe lead me how should i do that?

        Coding in backend is not really option for me asi dont want to mess something out

      • ChrisSka83
        ChrisSka83 commented
        Editing a comment
        this is not coding in the backend, but you enter a formula in the entity manager. Unfortunately, there's no getting around it. Without a formula -> no result.

    • #4
      <a rel="noopener noreferrer" href="https://www.northdata.com/{Lead.name}" style="display: inline-block; padding: 10px 20px; font-size: 16px; color: white; background-color: #007BFF; text-align: center; text-decoration: none; border-radius: 5px;">Click Me</a>

      This is the code i tried in WYSIWYG, it made me a buttong but PLACEHOLD is still not working...

      Comment


      • #5
        This is a button, which triggers the link to a Pdf, which is than displayed:

        //Button Print
        print = string\concatenate('<button type="button" class="btn-xs btn-primary" style="width: 100%;">', '<a rel="noopener noreferrer"',' ',
        'href="/?entryPoint=pdf&entityType=YOURENTITY&entityId= ',id ,'&templateId=YOUR TEMPLATE ID','"',' ', 'target="_blank">',
        '<span style="color: #fff; text-decoration: none;">','Print','</span></a></button>');

        to explain:
        print is the name of the WYSIWYG field
        You have to put the link together with all HTML as string/concatenate in formula
        The design of the button is Bootstrap, which works, because espoCRM uses Bootstrap. You will have all the design options, that Bootstrap offers for the button.
        For the link you do not ned to put the root URL. In case of the PDF template it is enough to call the PDF by the built in possibilieties to see, how the link looks. You can copy the part from ?entryPoint.
        You need to provide the entity name and the template ID.
        If you want to point to another URL, just look, what the normal link looks like, e.g. to open the create record page it would be something like #ENTITY/create.
        pPlace you WYSIWYG field and do recalculate, the button will appear.

        If you get stuck, post your needs, I can have a look.

        To get rid of the field Label, go to custom/Espo/Custom/Resources/layouts/YOURENTITY/detail.json, search for your field and append the noLabel

        {
        "name": "print",
        "noLabel": true
        }​

        Last edited by shalmaxb; 10-04-2024, 08:15 AM.

        Comment

        Working...
        X