Forum

Thread tagged as: Configuration, Discussion, Docs

How to link a button to a profile page that the client has created.

I have a static site that I'm planning to integrate into perch. what I'm trying to accomplish written below. I will post a link to the site and the code for the specific section.

The concept : a Talent booking company

1) the client will need to add a url or button under the talents profile photo.

2) Upon clicking the button the user will be directed to the talents profile page

Is there a way to accomplish this in perch by either having a url field in the cms where they can input the Talents profile page that they created. OR a dropdown menu where my client can select which page they want the button to link to based off of the pages they have just created?

Here is a link to the site: Damgoodtest.com Here is the code to the section in question. Thank you so much

</div> <div class="w-section client-section"> <div class="w-container client-container"> <div class="w-row"> <div class="w-col w-col-3 w-col-stack w-col-small-6 people-col"> <div class="people-main"><img class="main-image" src="images/nirvana_nevermind_album_cover.jpg"> <div class="name-title"> <h2 class="artists-name">Arnold Schwarzenegger</h2> <h2 class="location-of-artist">Location</h2><a class="button view-client" href="client-page-nirvana.html">View </a> </div> </div>

david moore

david moore 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

You would just create a Perch template to capture that information. Have a look st the tutorial videos.

https://docs.grabaperch.com/video/v/creating-a-perch-template/

We also have a pagelist FieldType https://grabaperch.com/add-ons/field-types/pagelist

Thank you but is there a tag that makes that button a link to that field type. Sorry I'm having a hard time wrapping my head around the concept

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Yes, you need to create a Perch template either to enter the URL, or using that fieldtype. That's how you do it, I really do suggest watching the video tutorials.

Great Thank you! one last thing . So im trying to add the link like your social media example but when i enter the link and save the web address disappears . Here's the code I used

div class="w-section event-div" data-ix="pop-up"> <div class="w-container event-contain"> <div class="event-body"> <div> <h1 class="event-name"><perch:content id="event" type="text" label="Event Name" /></h1> </div> <div> <h1 class="date"><perch:content id="date" type="text" label="Event Date" /></h1> </div> <div class="w-clearfix"> <h1 class="location"><perch:content id="location" type="text" label="Event Location" /></h1> </div> <div> <p class="event-information"><perch:content id="body" type="textarea" label="Article body" textile="true" editor="markitup" /></p> </div> <div class="w-clearfix"><a class="button buy-tix" href="<perch:content id=" purchase link" type="text" label="Purchase Tickets Link" />`">Buy Tickets</a> </div> </div> </div>

Rachel Andrew

Rachel Andrew 394 points
Perch Support

An id cannot have a space in it.

Lol wow thank you . Also is there a script where the user can enter their own html code? Like a soundcloud, YouTube , or Vimeo embed block ?

Also I took the space out and I'm still receiving a message that says :

Not Found

The requested URL /youtube.com` was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Here is my code

<div class="w-section event-div" data-ix="pop-up">
  <div class="w-container event-contain">
    <div class="event-body">
      <div>
        <h1 class="event-name"><perch:content id="event" type="text" label="Event Name" /></h1>
      </div>
      <div>
        <h1 class="date"><perch:content id="date" type="text" label="Event Date" /></h1>
      </div>
      <div class="w-clearfix">
        <h1 class="location"><perch:content id="location" type="text" label="Event Location" /></h1>
      </div>
      <div>
        <p class="event-information"><perch:content id="body" type="textarea" label="Article body" textile="true" editor="markitup" /></p>
      </div>
      <div class="w-clearfix"><a class="button buy-tix" href="<perch:content id="purchaselink" type="text" label="Purchase Tickets Link" />`">Buy Tickets</a>
      </div>
    </div>
  </div>
Drew McLellan

Drew McLellan 2638 points
Perch Support

At what point do you get that error? The message The requested URL /youtube.com suggests that you're entering a URL without the https://

I enter the entire http ( copy and paste from the browser) then when I save. and go to test the site and oress the link I get the 404 message

Hmm for some reason it bean to work. Go figure? now is there a way for the user to be able to enter thier own code block to embed a soundcloud or youtube embed code?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

You would create a template just in the same way. Anything you want the user to enter, you need to create a field for that.

I have that field created but how would perch read that it's an html block ? Would it just be something like this ?

<perch:content id="body" type="html" label="your HTML Here" textile="true" editor="markitup" />

Hrere's the current code but I believe that it is now out dated for soundcloud so I would rather it just be a custom html code that the user can put in . So woul dI use the code in my earlier reply ?

<div class="w-col w-col-6"> <div class="bio-div sound-cloud"> <div class="bio-header"></div> <div class="bio-paragrah sound-cloud"> <perch:if exists="soundcloud_id"> <iframe width="100%" height="300" scrolling="no" frameborder="no" src="https:////api.soundcloud.com/tracks/<perch:content id="soundcloud_id" type="text" label="Soundcloud ID" />"></iframe> </perch:if> </div>

Rachel Andrew

Rachel Andrew 394 points
Perch Support

https://docs.grabaperch.com/docs/templates/attributes/type/textarea/

You would use html="true" on your textarea field, as covered in the documentation.

So I went with redactor instead for time's sake and here's the code. The problem is that I can see it on the back end but when I go to save it the html doesn't hold and the content disappears. Have I entered something wrong?

<div class="w-col w-col-6"> <div class="bio-div sound-cloud"> <div class="bio-header"></div> <div class="bio-paragrah sound-cloud"> <div class="<perch:content type="textarea" editor="redactor" html="true" />"> </div>

Drew McLellan

Drew McLellan 2638 points
Perch Support

Your tag needs an id.

Awesome so now the embed content stays when i save but it still does not appear when i load the site. Thanks for all of your help!

<div class="w-col w-col-6"> <div class="bio-div sound-cloud"> <div class="bio-header"></div> <div class="bio-paragrah sound-cloud"> <div class="<perch:content id="htmllink" type="textarea" editor="redactor" html="true" /> </div>

Drew McLellan

Drew McLellan 2638 points
Perch Support

Check your HTML - I think you've opened a class attribute that you don't close.

Awesome thank you! That worked!