Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| info:concrete5:docfred:attributs [2015/04/03 07:44] – créée radeff | info:concrete5:docfred:attributs [2020/09/08 14:39] (Version actuelle) – radeff | ||
|---|---|---|---|
| Ligne 6: | Ligne 6: | ||
| Quelques astuces pour travailler avec les attributs | Quelques astuces pour travailler avec les attributs | ||
| + | ===== Permissions ===== | ||
| + | On peut granulariser finement les permissions sur les attributs | ||
| + | |||
| + | {{: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | ====== Page ID ====== | ||
| + | |||
| + | Pour trouver l' | ||
| + | <code php> | ||
| + | $page = Page:: | ||
| + | $page-> | ||
| + | </ | ||
| + | ou encore: | ||
| + | | ||
| ===== Afficher la vignette de la page sur la page ===== | ===== Afficher la vignette de la page sur la page ===== | ||
| - | Si on suit la [[info: | + | //Si on fait une vignette pour une page à afficher dans une liste de page, il peut être bien pratique d' |
| + | |||
| + | Si on suit la [[info: | ||
| <code php> | <code php> | ||
| <?php | <?php | ||
| - | $image = $c-> | + | $ih = Loader:: |
| + | $img = $c-> | ||
| + | $image = $ih-> | ||
| if ($image) { | if ($image) { | ||
| - | $afficheimage = $image-> | + | echo "< |
| - | echo "< | + | } |
| - | } | + | ?> |
| + | </ | ||
| + | |||
| + | |||
| + | ===== Using Page Attributes in Concrete5 Themes ===== | ||
| + | source: http:// | ||
| + | |||
| + | ==== Display Page Title ==== | ||
| + | <code php> | ||
| + | <?php echo $c-> | ||
| + | </ | ||
| + | ==== Display Page Description ==== | ||
| + | <code php> | ||
| + | <?php echo $c-> | ||
| + | </ | ||
| + | ==== Display Page Date ==== | ||
| + | <code php> | ||
| + | <?php echo $c-> | ||
| + | </ | ||
| + | This displays the date in default format like this: 2009-06-15 14:09:00. | ||
| + | |||
| + | To display the date in a format like this – June 06, 2009 – use this code: | ||
| + | <code php> | ||
| + | <?php echo $c-> | ||
| + | </ | ||
| + | See more about the PHP date function for other date/time formatting. | ||
| + | ==== Display Any Page Attribute ==== | ||
| + | <code php> | ||
| + | <?php echo $c-> | ||
| + | Display a Page’s Parent Page Name | ||
| + | <code php> | ||
| + | <?php | ||
| + | $page = Page:: | ||
| + | print $page-> | ||
| ?> | ?> | ||
| </ | </ | ||