How do I edit this page?

Permalink 1 user found helpful
I would like to edit a page but I can't see it when I'm logged in. I tried to get to it by changing permissions or looking thru the Sitemap System Pages but it's not the same page... Seems like any page that a user has permission to edit automatically gets permission to view - duh, that makes sense :) but how would I edit the page??? The page I want to edit is the page a guest gets redirected to when the page permission is set to "Registered Users".

Example: Visit my site and click "Library" then any category on the left other than "Library Updates". You will be redirected to a page asking you to login. I would like to add the image slideshow to that page and something to the effect of "only registered users get to see that page..."

It's not the same as "Page Not Found" or "Page Forbidden" any ideas?

dhoeschen
 
jordanlev replied on at Permalink Reply
jordanlev
The login page is a special kind of page called a "single page". There's a couple of different ways to achieve what you want, but I think the best thing to do in your case is to find your theme files and modify the "view.php" file and add an editable area above the "<?php print $innerContent; ?>" line -- add something like this:
<?php
$a = new Area('Top Content');
$a->display($c);
?>


One more thing you'll need to do for this to work: find your config/site_theme_paths.php file and add the following two lines to the very bottom:
$v = View::getInstance();
$v->setThemeByPath('/login', "yourtheme");

(replace "yourthemename" with your theme's name -- all lowercase, replace spaces with underscores)

NOW, go to the SiteMap in your dashboard, and check the box that says "Show System Pages" -- you should see the login page appear in the list. Visit that page and you should be able to edit it -- add the slideshow to the new "Top Content" area that should appear now.

For more info on single pages, see this:
http://www.concrete5.org/documentation/developers/pages/single-page...
dhoeschen replied on at Permalink Reply
dhoeschen
Thanks jordanlev I added the "Add to top content" area maybe I'll add something there in the future.

I have edited my site_theme_paths.php file already and do have a custom login page. I have no problem editing my regular login page located at "http://www.granitecityperformance.com/concrete5/index.php/login/". I'm wondering how to edit a different login page when trying to access a page that I do not have permission for: "http://www.granitecityperformance.com/concrete5/library/technical-documents/" it doesn't list it's page name just the no-access page I tried to view.
jordanlev replied on at Permalink Reply
jordanlev
Huh, that's weird... I thought there was only one login page, and that trying to access any restricted page redirected you to that login page. But you're right -- you seem to have two different login pages on your site. I honestly have no idea how to access that other page.

I'm guessing it's not actually a page but some kind of partial page "element" being brought in. Is that "technical-documents" page generated from an addon of some kind, or is it just a regular page you added to the site and set permissions on?
dhoeschen replied on at Permalink Reply
dhoeschen
It's just a regular page that has no guest permissions.
jordanlev replied on at Permalink Best Answer Reply
jordanlev
Very bizarre. Looking at the pages you linked to, I can see that they are in fact both the login page (they both have those thin black dotted lines above the login fields) -- but the one that's at the /login/ address is showing the image while the other page is not.

First I would try clearing the site cache (from the dashboard). If that doesn't fix it, then I think a different approach is necessary...
Instead of doing what I suggested above (where you have an area on the page you can edit), just hard-code a reference to a global scrapbook block so it will always show up on every login page no matter what (hopefully -- not 100% sure this will work). To do this, go back and edit the single_pages/login.php file and take out the "$a = new Area('Top Content'); $a->display($c);" chunk of code, and in its place put this:
$block = Block::getByName('Login_Page_Header');  
if( $block && $block->bID ) $block->display();


Now you need to create a block called "Login_Page_Header" in your global scrapbook (see documentation about how to do this).

Let me know if that works. If not, I'm out of ideas :)
dhoeschen replied on at Permalink Reply
dhoeschen
Thanks for the help, I was able to get it to work!

Editing the single-page "login.php" did not format correctly so I added the code to the "header.php" from my theme.

Pros:
Hey, it works! The image will be on all pages.

Cons:
I had to go back and re-edit all my pages to remove the duplicate code. I lost the second line that was under the image but I'm ok with that.
dhoeschen replied on at Permalink Reply
dhoeschen
By re-arranging the code in "header.php" I was able to get my divider line back but now I have a different problem... The image does not stay inside the lines - each new image drops below and creeps down the page. I have a workaround: set the image delay to 1 day (86400 seconds). Here's the code from the header, see any problems?

<div class="spacer"></div>
        <?php  if ($c->isEditMode()) { ?>
        </div>
        <?php  } ?>
        <div id="header-area">
            <div class="divider"></div>
            <div id="header-area-inside">
            <?php             
            $ah = new Area('Header');
            $ah->display($c);            
            $block = Block::getByName('Random_Image');  
            if( $block && $block->bID ) $block->display(); 
            ?>
        </div>    
            <?php  if ($ah->getTotalBlocksInArea() < 10) { ?>
jordanlev replied on at Permalink Reply
jordanlev
I'm stumped on that one -- sounds like some kind of styling glitch, although I haven't had it happen before with the slideshow block. Your workaround sounds like a good solution.