is_page

2 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Adam

ungelesen,
10.05.2008, 21:12:3610.05.08
an habari-users
In Wordpress, (spits in corner), you can call a function based on the
page slug:

<?php if ( (is_home())?>
<p>this is the homepage!</p>
<?php } } ?>

Now, I would have assumed that should this be possible in Habari, the
code would be:

<?php if ( is_page( 'about' ) ) :?>
<p>Yes, it's an extender! Fantastic. That is the icing on the cake.</
p>
<?php endif; ?>

However, all this does is kill my sidebar, (which is where I am
calling it from).

All correct answers are in the running for the grand prize of empty
promises in a variety of colours.

Andrew da Silva

ungelesen,
10.05.2008, 23:15:3210.05.08
an habari-users
I'll take a blog design for 500 Bob!

$request->display_home

display_home being the RewriteRule name, for a specific page, you'ld
do $request->display_page (or display_entry) with a check against the
$post->slug == 'about'

Did that make sense?

Adam

ungelesen,
11.05.2008, 05:19:1511.05.08
an habari-users
Erm... no, sorry that didn't make sense.
I'm going to need more help, where am I putting the $request->, on the
page I want the information displayed, or in the theme.php.

Also, how are I structuring the code, is it all in one long php line,
or top and tailing my content?

Once I know, I'll stick it in the wiki if only so I know myself next
time!

rick c

ungelesen,
11.05.2008, 08:58:2411.05.08
an habari-users
$request is a member variable of the theme class you are using, so it
is more commonly used in one of the theme's templates. If you do use
it in your theme.php, it would need to be refer to in the form $this-
>request->*type of page requested*. http://wiki.habariproject.org/en/User:mikelietz
lists the built-in page types that can be attributes of the $request
object.

For the 'about' example you gave, code similar to

<?php if ( $request->display_home && $post->slug == 'about' ) { ?>
<p>We're on the home page, Bob!</p>
<?php } else { ?>
<p>Help! I'm being held captive!</p>
<?php } ?>

should work.

Rick

Adam

ungelesen,
11.05.2008, 15:16:2711.05.08
an habari-users
That's great, thank-you.


On May 11, 1:58 pm, rick c <rickcock...@gmail.com> wrote:
> $request is a member variable of the theme class you are using, so it
> is more commonly used in one of the theme's templates. If you do use
> it in your theme.php, it would need to be refer to in the form $this->request->*type of page requested*.http://wiki.habariproject.org/en/User:mikelietz

mikelietz

ungelesen,
14.05.2008, 22:05:0614.05.08
an habari-users
Hm, since this is actually useful information perhaps it belongs in
the regular wiki hierarchy. Where do objects go?

On May 11, 8:58 am, rick c <rickcock...@gmail.com> wrote:
> $request is a member variable of the theme class you are using, so it
> is more commonly used in one of the theme's templates. If you do use
> it in your theme.php, it would need to be refer to in the form $this->request->*type of page requested*.http://wiki.habariproject.org/en/User:mikelietz

Adam

ungelesen,
15.05.2008, 09:51:0415.05.08
an habari-users
I've wikified the responce from Rick C:

http://wiki.habariproject.org/en/Request_Display_Content

There are some points I want to test regarding certain page types,
I'll finish it when I get home tonight.
> > > > > promises in a variety of colours.- Hide quoted text -
>
> - Show quoted text -
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten