Jump to content

To Add more Field-Url to same template


Recommended Posts

If I understood correctly what is the need, here is another simple idea I used in the past to have a text field where you can add hundreds of url's one per line.

After that, wherever you need to pull every url, you just grab the line and you are done:

<?php   foreach(explode("\n", $page->your_urls_text_field) as $url) { // Explode every new line as a new url
echo "<p>$url<br />"; //You can add <a href.. etc.
} ?>

The only requirement is to have every new url on a new line to make it work. Hope that helps...

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...

@franciccio-ITALIANO I do not thing that somebody other than you could say what is the best practice in such a simple matter so just pick the one you feel is making more sense and try it out. Again, it all depends on your preferences and the idea behind it. We just provided a few ways to accomplish it but the rest is up to you. Try one and see how it works. If not, try the next, the next and so forth until you are good with what you have :) (at least this is what I do) 

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...