[RÉSOLU] Text in home.php

PaulRPaulR Member
février 2011 modifié dans Entraide
I'd like to insert some home page text in home.php rather than use a static home page. If I insert it here...
<?php include(dirname(__FILE__).'/header.php'); # On insere le header ?>
<div id="page">
	<div id="content">

INSERT HERE

		<?php while($plxShow->plxMotor->plxRecord_arts->loop()): # On boucle sur les articles ?>
Will that be ok or will it upset anything else?

(pardon je ne parle (ou ecrire!) pas bien le Francaise mais je peux le lire

Merci

Paul

EDIT

I would also comment out the following line so only n items are shown on this 'home page'
<!-- <p id="pagination"><?php $plxShow->pagination(); ?></p> -->

Réponses

  • StéphaneStéphane Member, Former PluXml Project Manager
    Yes to both :)

    1. the best way is to define a div tag to insert your code like this:
    <div class="mytext">
        Lorem Ipsum is simply dummy text of the printing and typesetting industry
    </div>
    
    In style.css you can ajust settings on how to display the content of the div tag

    for example:
    .mytext { 
      background-color:#dedede;
    }
    
    2. If you comment out the pagination, only n items will be displayed (depending on admin parameter: articles per page)
    <!-- <p id="pagination"><?php $plxShow->pagination(); ?></p> -->
    

    Consultant PluXml

    Ancien responsable du projet (2010 à 2018)

  • Thanks Stephane. I'm ok with html & basic CSS but know next to nothing about PHP (although it looks pretty straightforward as I know C, Pascal, Basic etc).

    I've discovered a slight problem with this though - disabling the pagination doesn't show the latest articles which is what I was trying to achieve. If pagination is enabled then the inserted text will be visible at the top of each page rather than just on the home page. Hmmmm..... is there a better way to achieve that? What I'm trying to get is...

    [Home page]
    Welcome text
    Latest articles

    [next page]
    older articles]

    [next page]
    older articles]
    etc

    Many thanks

    Paul
  • StéphaneStéphane Member, Former PluXml Project Manager
    Ok I see

    In home.php, add this
    <?php if(!$plxShow->plxMotor->get OR preg_match('/page1$/',$plxShow->plxMotor->get)) : ?>
    		<div class="welcome">
    			Lorem Ipsum is simply dummy text of the printing and typesetting industry
    		</div>
    		<?php endif; ?>
    
    Welcome message will be only displayed on the first page

    Consultant PluXml

    Ancien responsable du projet (2010 à 2018)

  • Parfait!

    Merci bien :D

    Paul
Connectez-vous ou Inscrivez-vous pour répondre.