0
Welcome Guest! Login
0 items Join Now

Links to Content Items in BlockContent

  • Links to Content Items in BlockContent

    Posted 9 years 2 months ago
    • I've setup a BlockContent particle to display a list of sponsor logos. I want those logos to link to their respective websites. There is no option however to include that link in the Content Item setup for each of these. Am I missing something? This seems like it shoudl be easy.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13482
    • Web Designer/Developer

    Re: Links to Content Items in BlockContent

    Posted 9 years 2 months ago
    • what template?
      link to your site?
      Please do a screengrab of your problem and annotate to make it clear.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: Links to Content Items in BlockContent

    Posted 9 years 2 months ago
    • I'm using the Salient template. The site is still hosted locally, so not avialable to look at online. I didn't include this information previously because I felt it was more a Gantry question than a template question. Following are two screengrabs of the blockcontent options, as well as how the items are being displayed. I simply want each logo (content item) to be linked.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13482
    • Web Designer/Developer

    Re: Links to Content Items in BlockContent

    Posted 9 years 2 months ago
    • Every template has different particles and different versions/flavours of those particles so it's vitally important that your tell use the template name and post in the correct template forum. 99% of the time we will ask for a link to your site when you post in the forum, this avoid misunderstanding and allows us to look at the code and page live to diagnose the issue. For that reason you may find it better to develop your site on the net rather than locally (even if in offline mode).

      Ok well I agree with you that it should work differently to the way it actually does so I will create a bug ticket.

      If you wanted this functionality then you would need to create an override for the blockcontent particle yaml and twig to add in a field for the items and then to use it in the html. http://docs.gantry.org/gantry5/tutorials/overriding-particle-settings#overriding-particle-source-files

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13482
    • Web Designer/Developer

    Re: Links to Content Items in BlockContent

    Posted 9 years 2 months ago
    • This message contains only secure information that is visible to MrT, moderators and administrators
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: Links to Content Items in BlockContent

    Posted 9 years 2 months ago
    • Understoo Mark. I'll see about trying to get the site uploaded online for this very thing.

      In the meantime, I tried to follow the guide you linked to. What I'm trying to do is slightly different though, in that I need to add a field to a sub content item in the blockcontent particle. I've attached my edited files which now reside in my template>custom>particles folder.

      The field is not showing up however, when I try to setup a new particle, or edit the existing one. Do you see something that I've done wrong here?

      If nothing is apparent, I'll wait until I have the site online for you to review the specific files. Thanks for the assistance.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13482
    • Web Designer/Developer

    Re: Links to Content Items in BlockContent

    Posted 9 years 2 months ago
    • 1. Your indentation is wrong in the yaml - it's absolutely vital that indentation is correct in yaml as it has meaning.
      2. Your use of the new field is incorrect too it should be {{ url(subcontent.site)|e }} and remove the reference to default(gantry_base) - default should be defined in the yaml instead of twig.

      Regards, Mark.
    • Last Edit: 9 years 2 months ago by MrT.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: Links to Content Items in BlockContent

    Posted 9 years 2 months ago
    • Almost there. Fixed the tab issue on the YAML file. Field is now avialable in the particle settings.

      Still having difficulty with the TWIG though. Put in the code you suggested, but getting an "Error when rendering blockcontent particle." now. Below is my current code
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13482
    • Web Designer/Developer

    Re: Links to Content Items in BlockContent

    Posted 9 years 2 months ago
    • Now I'd have to see it to be able to assist you.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: Links to Content Items in BlockContent

    Posted 9 years 2 months ago
    • This message contains only secure information that is visible to MrT, moderators and administrators

Time to create page: 0.054 seconds