Jump to content

gregory

Members
  • Posts

    95
  • Joined

  • Last visited

Posts posted by gregory

  1. 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

    //Call image
    foreach($story->galleria as $img) {
      echo "<img src='{$story->galleria->first()->url}' alt='{$story->galleria->first()->description}'>";
    }

     

  2. 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

  3. 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>";
    }
    ?>

     

  4. 1 hour ago, gregory said:

    Hi Soma, I need to create a menu with the centered logo as in the attached example. My idea is to create two different menus. How can it be done?
    Thank you

     

    multiple-menu.png

    I solved by excluding pages. Great! :lol:

     

     

  5. 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>";
    ?>

     

×
×
  • Create New...