0
Welcome Guest! Login
0 items Join Now

SOLVED Accelerated Modded Particles (AMP)

  • SOLVED Accelerated Modded Particles (AMP)

    Posted 8 years 6 months ago
    • Can anybody help me with this, please?

      I am trying to create URL fields to a couple of particles in the Salient template. The instructions are helpful to an extent but I am not a CSS or PHP expert so vague instructions are only so helpful. :(

      I have located which files to copy and edit for the Salient template but do not know exactly where and what to change to make this happen in this specific particle.

      This is where I am getting lost: the contact.html.twig file I need to edit does not match up (well enough for me to figure it out) with these instructions.

      Now we edit imageblock.html.twig so find this code, around Line#15:


      <span class="g-imageblock-img"><img alt="image" src="{{ url(listgriditem.image)|e }}"/></span>
      
      
      and we'll change that line to:
      
      <span class="g-imageblock-img"><a href="{{ url(listgriditem.site | default(gantry_base)) }}"><img alt="image" src="{{ url(listgriditem.image)|e }}"/></a></span>
      
      
      then around Line#19 find:
      
      <span class="g-imageblock-title"><a href="">{{ listgriditem.headline|raw }}</a></span>
      
      
      and we'll change that line to:
      
      <span class="g-imageblock-title"><a href="{{ url(listgriditem.site | default(gantry_base)) }}">{{ listgriditem.headline|raw }}</a></span>
      
      
      lastly around Line#23 find:
      
      <span class="g-imageblock-title"><a href="">{{ listgriditem.titlebottom }}</a></span>
      
      
      and we'll change that line to:
      
      <span class="g-imageblock-title"><a href="{{ url(listgriditem.site | default(gantry_base)) }}">{{ listgriditem.titlebottom }}</a></span>



      My contact.html.twig file looks like:


      {% extends '@nucleus/partials/particle.html.twig' %}
           
          {% block particle %}
           
          	{% if particle.title %}<h2 class="g-title">{{ particle.title|raw }}</h2>{% endif %}
           
          	<div class="g-contact {{ particle.class|e }}">
          		{% set contactmap %}
          			{% for map in particle.maps %}
          			<div class="g-contact-map" style="background: url('{{ url(map.img)|e }}') no-repeat; min-height: {{ map.height|e }}">
          				{% if map.overlay %}
          				<div class="g-contact-map-overlay"></div>
          				{% endif %}
          				{% if map.marker %}
          				<div class="g-contact-map-marker" style="top: {{ map.top|e }};left: {{ map.left|e }}">
          					<i class="{{ map.icon|e }}"></i>
          				</div>
          				{% endif %}
          			</div>
          			{% endfor %}
          		{% endset %}
          		
          		{% if particle.mapposition == 'top' %}
          			{{ contactmap }}
          		{% endif %}
          		
          		{% for contactitem in particle.contactitems %}
          		<div class="g-contact-item">
          			{% if contactitem.icon %}<div class="g-contact-icon"><span class="{{ contactitem.icon }}"></span></div>{% endif %}
          			{% if contactitem.label %}<div class="g-contact-label">{{ contactitem.label|raw }}</div>{% endif %}
          			{% if contactitem.text %}<div class="g-contact-text">{{ contactitem.text|raw }}</div>{% endif %}
          		</div>
          		{% endfor %}
          		
          		{% if particle.mapposition == 'bottom' %}
          			{{ contactmap }}
          		{% endif %}
          	</div>
           
          {% endblock %}
    • Last Edit: 8 years 5 months ago by Amanda Doane.
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 21649
    • Thanks: 3104
    • messin' with stuff

    Re: SOLVED Accelerated Modded Particles (AMP)

    Posted 8 years 5 months ago
    • You don't need to know any PHP... tis the beauty of YAML+TWIG

      Please describe what you're trying to change/add in your Contact Particle
    • SEARCH the forum first! These boards are rich in knowledge and vast in topics. This includes searching just the 'Solved' forums, using Google, and using ChatGPT :woohoo:
  • Re: SOLVED Accelerated Modded Particles (AMP)

    Posted 8 years 5 months ago
    • Someone connected me to the correct AMP guide DanG posted so I got the map URL to work, finally. Now, applying the target new window option and adding URL options to the blockcontent particle with the target new window option as well is my next mission. I've gone through the guides but don't see one for blockcontent and the target new window guides I am not sure apply to either of these particles, plus even though I am logged in, I am unauthorised to view the screenshots from those posts for some reason. Any ideas on any of these items? I appreciate your reply.
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 21649
    • Thanks: 3104
    • messin' with stuff

    Re: SOLVED Accelerated Modded Particles (AMP)

    Posted 8 years 5 months ago
    • not sure the YAML to make "open in a new window" an option... but you could just edit the TWIG file to include target="_blank" in your <a> tag
    • The following users have thanked you: Amanda Doane

    • SEARCH the forum first! These boards are rich in knowledge and vast in topics. This includes searching just the 'Solved' forums, using Google, and using ChatGPT :woohoo:
  • Re: SOLVED Accelerated Modded Particles (AMP)

    Posted 8 years 5 months ago
    • Matt wrote:
      not sure the YAML to make "open in a new window" an option... but you could just edit the TWIG file to include target="_blank" in your <a> tag
      Works perfectly. Thanks!!

Time to create page: 0.052 seconds