-
Posts
95 -
Joined
-
Last visited
Posts posted by gregory
-
-
Hi guys, I need help.
how do I translate Next Page?<?php if($page->next->id) {echo "<div class='float-right'><a class='button' href='{$page->next->url}'> Next Page </a></div>";} ?>
I usually use this:
<?php $lang = $user->language->name; if($lang == 'default') {echo "Next Page";} else {echo "Pagina successiva";} ?>
or
<?php echo __("Next Page"); ?>
Thanks
-
Hi, does the module also support multiple languages?
-
6 minutes ago, flydev said:
Already glad you switched from WP to PW ???
Now the new websites I build them only with Processwire. It is a powerful CMS and the community is very serious and professional. ?
- 2
-
To be exact, I did this:
if(count($story->imagefieldname)) { ... }
Thank you again!
- 1
-
Thanks so much! Now it works perfectly. Can I offer you a coffee? ☕
- 1
- 1
-
It is right (sorry I come from WP). But in my case I have a page with a list of articles and the image field is also called in the article that has no image.
-
Thank You for your response.
In my case I need to write this, because I am in the post archive:
if ($ story-> imagefieldname) {
...
}But it does not work as it should because it recalls an image in other posts ...
-
-
Hi guys, is it possible to set a menu item that points to an external url? Thank you
-
Thank You @Zeka
I solved with Code Internationalization (i18n)
-
Hi, I'm working on a bilingual site (it / en). I would need to automatically translate the classic "Continue reading". How can I do?
Thanks in advance.
<?php $stories = $page->children("limit=3, sort=-date"); foreach($stories as $story) { echo "<div>"; echo "<h2><a href='{$story->url}'>{$story->title}</a></h2>"; echo "<div>{$story->summary}</div>"; echo "<a href='{$story->url}'>Continue reading</a>"; echo "</div>"; } ?>
-
-
-
Thank You, it works fine
- 1
-
Hello guys, how can I view the image field? I need to view the Image associated to the post of the news. Thank you
Spoiler<?php echo "<div class='row'>"; $stories = $page->children("limit=4, sort=-date"); foreach($stories as $story) { echo " <div class='col-lg-3'> <img src='{$image->url}' alt='{$image->description}' /> </div>"; echo " <div class='col-lg-9'> <h1><a href='{$story->url}'>{$story->title}</a></h1> <p><strong>Date:</strong> {$story->date}</p> {$story->body} </div> "; } echo "</div>"; ?>
Show only the first image
in General Support
Posted
Hi guys.
I would like to show only the first image as a preview of a slideshow. The code below shows the first image but is repeated. Do you know a solution? Thank you