Forum

Thread tagged as: Question

URL Links

Hello,

On my website I have some read more buttons with a link to the content. How would I make these dynamic in Perch.

I also have a blog with read more on each blog post is there a way to do the same as the above so that the link dynamically goes to that blog post.

Thanks

Rob

Rob Broley

Rob Broley 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

On my website I have some read more buttons with a link to the content. How would I make these dynamic in Perch.

We would need to see more information such as your template. Is this a list/detail type setup?

I also have a blog with read more on each blog post is there a way to do the same as the above so that the link dynamically goes to that blog post.

If you are using the blog app then this happens automatically. Again, we need more information to be able to help if you are experiencing a problem with that.

Sorry Rachel. My website URL is www.robertbroley.co.uk

I've only installed perch yesterday is I am working through it slowly.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

The video tutorial then is the best place to start:

https://docs.grabaperch.com/video/tutorials/swift/

That takes you through building an entire site with Perch and should answer most of your initial questions.

<a class="btn btn-main" href="ui-ux-design.php">Learn More</a>

This is the link that I have attached to a button is there any way in perch that I can add a new href link dynamically?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes. In the most basic case, you could make that a region:

<a class="btw btn-main" href="<?php perch_content('URL'); ?>">Learn More</a>

but that's probably not what you want. If you can give us some context, that would help.

Drew McLellan said:

Yes. In the most basic case, you could make that a region:

<a class="btw btn-main" href="<?php perch_content('URL'); ?>">Learn More</a>

but that's probably not what you want. If you can give us some context, that would help.

Thanks Drew. I will try that and I will also try a template with that and see how I get on.

Its worked so I am happy. Thanks

That code seemed to work but I have <a href="responsive-web-design.php">Responsive Web Design</a> in a text block of code and perch does not seem to like it as it says it cannot find the url

Drew McLellan

Drew McLellan 2638 points
Perch Support

What should the URL be?