I followed Shouvik Mukherjee's (thanks for your tutorial by the way) steps in Elgg 1.8.0, but ran into an issue. Externalpages in Elgg 1.8.0 doesn't have:\mod\externalpages\views\default\expages\footer_menu.php\ the footer_menu.php was actually incorperated into externalpages start.php for 1.8, so if you are running 1.8 and are getting irritated that your pages aren't showing up or aren't working, here is the modification with respect and steps by Shouvik Mukherjee :
1) Open this directory – \mod\externalpages\languages\en.php\ and seek the following line-
‘expages:privacy’ => “Privacy”,
Add the following code after this line-
‘expages:yourpagename’ => “yourpagename”,
2) Open this directory – \mod\externalpages\start.php and seek the following line-
function expages_setup_footer_menu() {
$pages = array('about', 'terms', 'privacy'); which starts on line 30
Add the following code after this line-
function expages_setup_footer_menu() {
$pages = array('about', 'terms', 'privacy', 'yourpagename');
3) Open this directory – \mod\externalpages\views\default\expages\menu.php\ and seek the following line-
<li <?php if($type == ‘privacy’) echo “class = ‘selected’”; ?>><a href=”<?php echo $url; ?>privacy”><?php echo elgg_echo(‘expages:privacy’); ?></a></li>
Add the following code after this line-
<li <?php if($type == ‘yourpagename’) echo “class = ‘selected’”; ?>><a href=”<?php echo $url; ?>yourpagename”><?php echo elgg_echo(‘expages:yourpagename’); ?></a></li>
4) Open this directory – \mod\externalpages\views\default\expages\forms\edit.php\ and seek the following line-
else if($type == ‘privacy’) {
$external_page_title = elgg_echo(‘expages:privacy’);
}
Add the following code after this line-
else if($type == ‘yourpagename’) {
$external_page_title = elgg_echo(‘expages:yourpagename’);
}
5) Save all files and upload the modified plugin.
6) Then, run the upgrade.php script by hitting http://SITEURL/upgrade.php in address-bar.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Lucius Beach@lucius.beach
Lucius Beach - 0 likes
- Ajay@ajay_yourgoal
Ajay - 0 likes
You must log in to post replies.Sorry!! I had to rewrite the steps! I didn't delete step 4 which isn't needed. Here is the proper steps:
1) Open this directory – \mod\externalpages\languages\en.php\ and seek the following line-
‘expages:privacy’ => “Privacy”,
Add the following code after this line-
‘expages:yourpagename’ => “yourpagename”,
2) Open this directory – \mod\externalpages\start.php:
· Copy: elgg_register_page_handler('privacy', 'expages_page_handler'); hit enter and paste right below it and chang “privacy” to your page name
· Scroll down to line 32 and edit:
function expages_setup_footer_menu() {
$pages = array('about', 'terms', 'privacy');
to look like:
function expages_setup_footer_menu() {
$pages = array('about', 'terms', 'privacy', 'yourpagename');
3) Open this directory – \mod\externalpages\views\default\expages\menu.php\ and seek the following line-
<li <?php if($type == ‘privacy’) echo “class = ‘selected’”; ?>><a href=”<?php echo $url; ?>privacy”><?php echo elgg_echo(‘expages:privacy’); ?></a></li>
Add the following code after this line-
<li <?php if($type == ‘yourpagename’) echo “class = ‘selected’”; ?>><a href=”<?php echo $url; ?>yourpagename”><?php echo elgg_echo(‘expages:yourpagename’); ?></a></li>
4) Save all files and upload the modified plugin.
5) Then, run the upgrade.php script by hitting http://SITEURL/upgrade.php in address-bar.
Hi,
I am trying to add a external page for terms and conditions and couln't find the code that you have mentioned in point "3".
I can only find the code that is mentioned below
<?php
/**
* External pages menu
*
* @uses $vars['type']
*/
$type = $vars['type'];
//set the url
$url = $vars['url'] . "admin/site/expages?type=";
$pages = array('about', 'terms', 'privacy');
$tabs = array();
foreach ($pages as $page) {
$tabs[] = array(
'title' => elgg_echo("expages:$page"),
'url' => "admin/appearance/expages?type=$page",
'selected' => $page == $type,
);
}
echo elgg_view('navigation/tabs', array('tabs' => $tabs, 'class' => 'elgg-form-settings'));
Please guide me on how to add an external page for my site