If page is profile page

Is there any line of code that i can add to the <body> to give the page another div class when you view the profile page?

In Wordpress for example you have this...

<?php if(is_front_page() ) { ?> //do stuff <?php } ?>
Quote · 3 May 2014

for profile.php

if(defined(BX_PROFILE_PAGE)) { //its profile page }

so much to do....
Quote · 3 May 2014

I can't get it to work :(

I want to add to the body tag in _header.html a div class  / id only when you are on the profile page.
No i get on any page <body class="bx-def-font ">. So he doesn't get the code.

How do i do this? I use the standard Base theme. 

Quote · 3 May 2014

what exactly are you trying to accomplish - you can use a php block on the profile page for the code you want to use. If there is no visual result, then the block will not show, but code will still run.

 

I have a block on my homepage and on the account page that checks a users member type. If a certain type, then their membership is upgraded to a special membership. If they already have that membership, then no changes are made. And since there is no visual output, the user does not even know the block is there.

 

Or you can use an injection to accomplish the same thing.

caredesign.net
Quote · 3 May 2014

I want to add a class to the body if you are on the profile page.
The reason is because the css for the profile page needs to be different page than on the other pages with the same elements / blocks. ( other color, width, background etc. ) 

Quote · 3 May 2014

In templates/base/_header.html

Find :

     class="bx-def-font"

Replace with :

      class="bx-def-font __extra_class__"

 

In inc/classes/BxDolTemplate.php

Find this code snippet :

            case 'is_profile_page':

                $sRet = (defined('BX_PROFILE_PAGE')) ? 'true' : 'false';
                break;

Just below it, add :

            case 'extra_class':
                $sRet = (defined('BX_PROFILE_PAGE')) ? 'someclass' : '';
                break;
 

someclass is the name of the class that should affect the Profile page only. Clear cache after making the changes.

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 3 May 2014

Thanks, Modzzz!!! It worked :)

Quote · 4 May 2014

Can i also do that with certain other pages?

Quote · 31 May 2014

How can i do that with the profile info page?

Quote · 10 Jun 2014

Do you mean you want the same class to appear for both Profile and Profile Info pages ?

How can i do that with the profile info page?

 

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 11 Jun 2014

Yes. Or another class if that's easier...

Quote · 11 Jun 2014

See below the full list of changes needed for both pages.

In profile_info.php

Find :

   <?php

Just below, add :

   define('BX_PROFILE_INFO_PAGE', 1);


In templates/base/_header.html

Find :

     class="bx-def-font"

Replace with :

      class="bx-def-font __extra_class__ __another_class__"

 

In inc/classes/BxDolTemplate.php

Find this code snippet :

            case 'is_profile_page':

                $sRet = (defined('BX_PROFILE_PAGE')) ? 'true' : 'false';
                break;

Just below it, add :

            case 'extra_class':
                $sRet = (defined('BX_PROFILE_PAGE')) ? 'someclass' : '';
                break;

            case 'another_class':
                $sRet = (defined('BX_PROFILE_INFO_PAGE')) ? 'someclass' : '';
                break;

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 11 Jun 2014

THANKS!!!! It worked...

Quote · 11 Jun 2014

And for the profile edit page?

Quote · 12 Jun 2014

And for the profile edit page?

Quote · 12 Jun 2014

We also need to give a different class to the member.php page. How can we do that?

Quote · 16 Jun 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.