Jump to content

Recommended Posts

Posted

Hi, 

In one Page I would like to put a lot of url.
There is url's field.
Now, I add url's field to one template, but I don't know to add 2 or 3 or 10 url's field in that same template... the problem is simple, but processwire don't allow it...

:huh:

Posted

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
  • 3 weeks later...
Posted

@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

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
×
×
  • Create New...