Menu items in moodle - moodle

I am new to moodle. I created a moodle site in that I create custom menuitems. After clicking on theose menu items for example I created menu items like Home, Aboutus, when i click on Aboutus menu item it shows aboutus details in my site where and how to create that aboutus page in moodle.
thanking you

The easiest way to create a page on a Moodle site is to use the 'page' resource type.
If you edit the 'front page' settings and tick the 'include a topic section' option (and click save changes!).
Then, back on the front page, turn editing on, click on 'Add an activity or resource' and create a new 'Page' resource.
Once you've created that page resource, you can then copy the link for that page (from the front page) and use that as the 'about us' link.

For example if you want to create a new page with a title "New page" and a header "External" you can create a new php file external.php or whatever and put the following code in it:
<?php
// file external.php is the the root directory of Moodle
require_once('config.php');
// Open the page if the user is logged in
if (isloggedin()) {
$PAGE->set_context(get_system_context());
$PAGE->set_pagelayout('standart');
$PAGE->set_title("New page");
$PAGE->set_heading("External");
// path to this file
$PAGE->set_url($CFG->wwwroot . '/external.php');
// Code for navigation bar (Home -> Important)
$PAGE->navbar->ignore_active();
$strHome = "important";
$PAGE->navbar->add($strHome, new moodle_url('external.php'));
// Output the header
echo $OUTPUT->header();
$htmlscr = "<h1>Hello world!</h2>";
// Actual content goes here
echo $htmlscr;
echo $jscr;
echo $OUTPUT->footer();
}
// Else output error message
else {
echo "<h2>Please log in to procede</h2>";
}
?>
This page can be seen by logged in users only. It works fine in my Moodle 2.6.
More details are in the Moodle documentation https://docs.moodle.org/dev/Page_API

Related

Generic way to hide install plugin link from wp-admin

I want to hide the install plugin link from wp-admin menubar in generic way . ie which ever plugin the user will install in future will not be visible to user in menubar . is it possible ?
You can remove the 'Plugins' menu item from the wp-admin dashboard by adding the below code to function.php in your theme,
<?php
function remove_menus(){
remove_menu_page( 'plugins.php' );
}
add_action( 'admin_menu', 'remove_menus' );
?>
By this you can hide the menu from user. (But page can be directly accessed)
Reference: https://codex.wordpress.org/Function_Reference/remove_menu_page
or if you want to remove submenu page from menu list, see the code at https://codex.wordpress.org/remove_submenu_page

How to redirect custom panel quick form to full form?

How to skip quick create form when I click on create action button on my custom subpanel?
I want to redirect when I click on create button. It needs to be redirected to full form on custom subpanel.
Do the changes in following files:
custom/Extension/modules//Ext/Layoutdefs/.php &&
custom/Extension/modules/relationships/layoutdefs/*.php
For your desired module/subpanel, change this line:
'widget_class' => 'SubPanelTopCreateButton',
by
'widget_class' => 'SubPanelTopButtonQuickCreate',
Then make a quick repair&rebuild.

inserting content of one template inside another umbraco

Im new to umbraco. im trying to display certain section of one template inside another template.
for e.g.
1) i have Product page, which lists all the products and few description about them.
2) now i want to show this content to my home page also. i dont want to copy and paste code from product page to home page..as this would require me to do the same if some changes come on product page.
Also, Product page contains child nodes, which automatically displayed by Macro.
i just want to display Product page contents to my home page.
Thanks in advance.
You simply need to add a new macro that will display the product page contents you need and then add it into the homepage template.
Doing it as a razor scripting file would be something like (where 1111 is your product page node id). If you use ucomponents you could use uQuery.getNodeByUrl or some other nicer helper method, but this code should work out of the box:
var productPage = #Model.NodeById(1111);
<div>
<a href="#productPage.Url">
<h4>
#productPage.copyHeadline
</h4>
</a>
#if (!string.IsNullOrEmpty (#productPage.copyBlurb.ToString ()))
{
#Html.Raw(#productPage.copyBlurb.ToString().Substring(0, 200) + "...");
}
</div>

Link home page rather then current when user clicks 'Add to Home Screen' on iPad/iPhone

I'm developing a web page built for iPad's.
If the user is on a product page and they click on 'Add to Home Screen' button.
Is it possible to have the index.html page rather then current(product.html)?
OR ALTERNATIVELY
Would it be possible to have your own link that could be used on all a site pages.
When clicked use javascript to simulate the 'Add to Home Screen' button and have your 'index.html' page added?
You can't control anything about the Add to Home Screen button, not even "press" it using javascript, that is why sites like youtube have a little popover above the button, asking users to press it.
However you may be able to do something like this:
On each page on your website add javascript code like:
//Maybe check if the user is on an iPad???
if (window.location.href != "your home page url" && navigator.standalone) {
if (!document.referrer) {
window.location.href = "your home page url";
}
}
All that does is check if the user has added the webpage to the home screen navigator.referrer == true, and then checks what webpage was visited previously, if it's nothing then the web app must have been started on a page that isn't the homepage, and so it should be sent to the homepage.
I've just typed that into the answer directly, so it may need some correction.

How can I link to a specific tab created with Dojo/Zend Combination

I have the following html / Javascript:
http://pastie.org/782618
And the following Zend PHP Code for the tabs:
http://pastie.org/782620
I would like to link to the Second Tab (Event Information2). If possible I would prefer to be able to have a button on the first tab that when clicked it goes to the next form. If that isn't possible I could also do a link to the second tab as long as it wouldn't refresh the page (there will be content in a form that will need to not be lost).
I figured it out, for future users:
$next = new Zend_Form_Element_Button ('next', array('onClick'=>"dijit.byId('createEventForm-TabContainer').forward()"));
$next->setLabel('Next');
$back = new Zend_Form_Element_Button ('back', array('onClick'=>"dijit.byId('createEventForm-TabContainer').back()"));
$back->setLabel('Back');