SOLVED - Want to ad...
 
Notifications
Clear all

SOLVED - Want to add a custom page.

9 Posts
3 Users
0 Reactions
1,887 Views
(@justmelissa)
Posts: 15
Active Member
Topic starter
 

I would like to add a custum page to the menu part. (the part with 'Home', 'Account Info', 'Terms Of Service' etc.)  But I don't know how and where. I managed to upload what I want to show, onto the site, in the Admin area, under 'Custum Pages' but I can't put a link to it, in the menu.


 
Posted : 21/07/2009 8:50 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

It's pretty easy, but it depends on how your skin(s) are configured. See this wiki article: https://efiction.org/wiki/index.php5?title=How_to_change_the_site_menu


 
Posted : 21/07/2009 9:17 pm
(@justmelissa)
Posts: 15
Active Member
Topic starter
 

I've tried what the wiki page told me and went to 'Blocks' in the Admin Panel and did as told. It didn't work. Then I changed the variables.php like the example given and it still didn't work. Lastly, I tried the third option and changed the header.tpl. It still doesn't work. What did I do wrong?

The header.tlp now:

<body>
<div id="container">
<div id="header">
<h1>{sitename}</h1>
<p>{slogan}</p>
</div>
<div id="navigation">
<ul id="navlist">
<li>{home}</li>
<li>{login}</li>
<li>{tos}</li>
<li>{rules}</li> 
<li>{help}</li>
<li>{contactus}</li>
<li>{recent}</li>
<li>{authors}</li>
<li>{catslink}</li>
<li>{titles}</li>
<li>{series}</li>
<li>{challenges}</li>
<li>{tens}</li> 
<li>{search}</li>
<li><p><strong>Site Skin</strong><br />{skinchange_content}</p></li>
</ul>
</div>
<div id="sidebar">
<div class="block">
<div class="title">{info_title}</div>
<div class="content">{info_content}</div>
</div>
<div class="block">
<div class="title">{categories_title}</div>
<div class="content">{categories_content}</div>
</div>
<div class="block">
<div class="title">{recent_title}</div>
<div class="content">{recent_content}</div>
</div>
<div class="block">
<div class="title">{online_title}</div>
<div class="content">{online_content}</div>
</div>
<div class="block">
<div class="title">{poll_title}</div>
<div class="content">{poll_content}</div>
</div>
</div>
<div id="content">
<!-- END BLOCK : header -->

The variables.php now:

<?php
$blocks["categories"]["status"] = 2;
$blocks["featured"]["status"] =  '0';
$blocks["info"]["status"] = 2;
$blocks["menu"]["status"] = '1';
$blocks["menu"]["content"] = array (
  0 => 'home',
  1 => 'recent',
  2 => 'authors',
  3 => 'catslink',
  4 => 'titles',
  5 => 'series',
  6 => 'search',
  7 => 'tens',
  8 => 'challenges',
  9 => 'help',
  10 => 'contactus',
  11 => 'login',
  12 => 'logout',
  13 => 'adminarea');
$blocks["menu"]["style"] = 1;
$blocks["login"]["status"] = 1;
$blocks['login']['acctlink'] = 2;
unset($blocks["login"]["template"]);
$blocks["login"]["form"] = 1; // Long form with register and lost password options
$blocks["random"]["status"] = 2;
$blocks["recent"]["status"] = 2;
$blocks['recent']['tpl'] = 0;
$blocks["skinchange"]["status"] = '1';
$blocks["news"]["status"] = 2;
$displayprofile = 1;
?>


 
Posted : 22/07/2009 1:19 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

Which of those is meant to be the new page? All of those look standard to me. Can you link me to the page you created?


 
Posted : 22/07/2009 4:17 pm
(@justmelissa)
Posts: 15
Active Member
Topic starter
 

This is the page someone created for me: http://www.cinemabizarrefiction.com/eFiction35/viewpage.php?page=warningguide
And I forgot I  reuploaded the variables.php, so thisis what in it now:

<?php
$blocks["categories"]["status"] = 2;
$blocks["featured"]["status"] =  '0';
$blocks["info"]["status"] = 2;
$blocks["menu"]["status"] = '1';
$blocks["menu"]["content"] = array (
  0 => 'home',
  1 => 'recent',
  2 => 'authors',
  3 => 'catslink',
  4 => 'titles',
  5 => 'warningguide',
  6 => 'series',
  7 => 'search',
  8 => 'tens',
  9 => 'challenges',
  10 => 'help',
  11 => 'contactus',
  12 => 'login',
  13 => 'logout',
  14 => 'adminarea');
$blocks["menu"]["style"] = 1;
$blocks["login"]["status"] = 1;
$blocks['login']['acctlink'] = 2;
unset($blocks["login"]["template"]);
$blocks["login"]["form"] = 1; // Long form with register and lost password options
$blocks["random"]["status"] = 2;
$blocks["recent"]["status"] = 2;
$blocks['recent']['tpl'] = 0;
$blocks["skinchange"]["status"] = '1';
$blocks["news"]["status"] = 2;
$displayprofile = 1;
?>

As you can see, the number 5 is the warning guide I want to add but it isn't showing up.

If I go to the admin panel and then to custom pages, this is what is on the bottom of the page:

The name you assign to your custom page will be the {NAME_link} variable for you to use in your skins. The script will append "_link" to the name to help prevent naming conflicts with other variables. The title will be the title of the page. For the URL of your custom page, you may use either viewpage.php?id=ID or viewpage.php?page=NAME where ID is the ID number of the page or NAME is the name of the page.
Note: The name for your page should contain letters, numbers, and the underscore character ONLY.

What does that all mean?


 
Posted : 22/07/2009 5:01 pm
(@babaca)
Posts: 722
Member Moderator
 

The way I would do custom page: I would go to Admin->Page Links
Click Add New Page Link
In the form
Name: warningguide
Text of Link: Warning Guide
Link Access Key: [leave this blank]
Link URL: viewpage.php?page=warningguide
Link Target: Same Window
Link Access Level: All

Click Submit.

Now in theory your variable should show up I think.

I've edited via Lyndsie's suggestion.


******************************************
Mucking around in eFiction since circa 2001 (ver. 1.0)
Now running v.3

 
Posted : 22/07/2009 5:25 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

What babaca said, but 'warningguide' as the name should be lowercase. I think that's case-sensitive, and it won't work if you put it uppercase W.

It also won't work if you're still using the name variables in index.tpl. You'd have to add it there. If that's not how the skin came originally I'd put it back the way it was to begin with.

What the description you quoted at the bottom of the page is saying is that when you create a custom page, a variable to put in the skin is automatically created. In the case of your page, it would be {warningguide_link}. However, you can also create your own page link as babaca suggested. The one she gives will work with what you've already got in variables.php. Otherwise, edit variables.php and add the _link to the name of #5.

The rest tells you two different URL formats that can be used to view the page, and tells you want kind of formatting the name needs to have.


 
Posted : 22/07/2009 5:31 pm
(@justmelissa)
Posts: 15
Active Member
Topic starter
 

The one babaca mentioned, didn't work and editing the variables.php didn't work either. However, I edited the header.tpl with the {warningguide_link} and now it's in the menu!! YAY!!  πŸ˜€ Thank you all for your suggestions!!

**Solved**


 
Posted : 23/07/2009 2:31 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

Cool. With babaca's suggestion, you would have had to add {warningguide} to the header.tpl. (Just so you know why it wasn't working.)


 
Posted : 23/07/2009 3:11 pm
Share: