Calling Navigation Menu from Master class in the Default Page - vb.net

I have my navigation menu declared in the master class. I want to use it in the Default page but for some reason is not picking it up! Just to note the menu items are declared in the SiteMap file!
Here is the Master class menu I am trying to call:
<asp:Menu ID="NavigationSiteMapMenu" runat="server" CssClass="menu"
Orientation="Horizontal" DataSourceID="SiteMapDataSource1">
Here is the code I am using it in Default Page (In the Page Load Method) :
Dim testMenu As Menu = CType(Master.FindControl("NavigationSiteMapMenu"), Menu)
And here I am testing if it returns list of items but it doesn't the count is 0.
Dim test = testMenu.Items
Do you guys have any idea why my above code is not working, the logic seems perfect to me but clearly not to VB.NET!

This is the correct syntax:
Dim testMenu As Menu = CType(Master.FindControl("NavigationSiteMapMenu"), Menu)
My problem was that on one of the aspx pages I wasn't referencing the Master page. So please make sure the Master Page is referenced in all the required pages.
All the best and Good Luck!

Related

Bigcommerce product image snippet in custom panel

I'm new to Bigcommerce and hoping someone can help me figure out if I'm doing anything wrong here. I'm simply trying to create a custom template for my product pages. I created a new file called "_product.html", uploaded it via FTP, and applied it to one of my products.
Within this file I have a default panel called ProductDetails.html. This panel makes a reference to the products thumbnail images. Everything works as expected.
However, I now copy the content from the ProductDetails.html panel and place it in a new panel called ProductInformation.html. At this point, there is no difference between ProductDetails.html and ProductInformation.html, except for the name.
I then go into my _product.html template and replace the reference to the ProductDetails panel with a reference to my new ProductInformation panel. Now, none of the snippets or global variables are being populated. They print nothing to the page.
If I put the original reference to the ProductDetails panel back, everything is displayed as expected. Is there something I'm missing here? Are the snippets and global variables used in the system-created ProductDetails panel only available in that file and not available to other custom panels created for a product page?
I really appreciate any help you can provide! Thank you!
As I recall, there is a key element inside of the ProductDetails Panel that is needed to get all the variables to work on a product page. I think the order even matters.
I would recommend using Snippets to control the information you want to swap out on a custom product page.
The ProductDetails panel populates the global variables that you are trying to use. If you do not have it on the custom page then you cannot use the variables inside of it. The workaround is to place the panel inside an HTML comment:
<!-- %%Panel.ProductDetails%% -->
That way the panel will be called by the Bigcommerce template system without affecting the rest of your layout.

Create new pages with a button using PageController

How would I programmatically create new pages that are controlled by the PageControl dots?
I want to create a button that makes pages. Each page should be added to the set of pages that you can flip through, using the page controller.
How would I go about doing this? I know that you can create a page like this:
-(IBAction)createPage:(id)selector {
CustomPageClass *customPage=[CustomPageClass aloc];
[self.view addSubView:customPage.view];
}
However, when the button is clicked again, how do I make it so that the next "view" is on another page accesible by the PageController?
Thanks much for any help.
If I got you right, you don't have to worry about create new page. It is done automatically. I hope it helps:
http://www.iosdevnotes.com/2011/03/uiscrollview-paging/

How to change the url of my entire page when a new tab is selected? (Dojo-Tabcontainer)

I have used Dojo-Tabcontainer to create tabs. I want to have a separate template for every tab. So, when a tab is clicked I want a new page to be loaded and the url to be changed.
Can you please suggest a way to do this using Markup instead of programmatic way?
I'm thinking of using Template Inheritance while creating html page for each tab to avoid redundancy.
I can get some clue from this:
How to change Dojo TabContainer behaviour to simply open an external link instead of showing a ContentPane?
But I'm not sure how to do it via Markup instead of programming.

Implementing a menu's "selected" links in Yii

I have two templates to integrate into yii - my front end website and my CMS.
My front end website has top menu that is generated by CMS (database)
CMS top menu which is static menu by me. ("Manage pages", "Manage users", "Manage products") although this menu is static I still want to assign a selected class to the appropriate top menu item.
Eg: If I'm managing some pages on the site the "Mange pages" link should be highlighted and selected. How would I go about this? Something I need to code myself or is there a existing function in yii that i need to refer to?
Thanks in advance
Yii newbie
What I do is have multiple "menu" functions in my Controller (AdminController extends Controller) class. Each one builds the array the CMenu needs, and I set the active one based on what I passed in to the function. For instance:
protected function getAdminMenu($activeTitle) {
return array(
array('label'=>'Manage pages', 'url'=>array('/user/purchase'),'active'=>($activeTitle=='Manage pages')?true:false),
array('label'=>'Manage users', 'url'=>array('/user/index'),'active'=>($activeTitle=='Manage users')?true:false),
);
}
You could do this where it looks like the Controller or Action or URL request and sets the appropriate menu item active as well. This is just an example.
Then in my view, if I want to render the menu with "Manage pages" active, I set my layout's Menu using the function in my Controller class:
$this->menu=$this->getAdminMenu('Manage pages');
(This assumes that you have public $menu=array(); declared in your Controller, and as well. Look at the Blog example to see how this works:
$this->widget('zii.widgets.CMenu', array(
'items'=>$this->menu,
));
)
I hope this gives you some direction!
Make a css class that changes the background of the object to highlight it.
In your views for the various pages just make the menu item have that particular class.

SharePoint: Programmatically moving pages and subsites on the current navigation menu

Does anyone know how to programmatically move/order the pages and subsites that appear in the Current Navigation when you have the Include subsites and include pages options ticked/enabled?
Background
I have written a class (in c#) which imports content into a new SharePoint site. The newly created subsites and pages all show on the Current Navigation menu as expected, but in the order they were created (I assume). I need to manually sort the pages on the menu so that they appear in the same order as the existing non-SharePoint site.
Issue
The PublishingWeb.Navigation.CurrentNavigationNodes collection does not contain any SPNavigationNode items for the pages and subsites that are automatically displayed on the Current Navigation menu, so I can't use this collection.
I know that to hide a particular page from the menu, you have to update a web property as follows:
web.AllProperties["__CurrentNavigationExcludes"] += page.UniqueId.ToString() + ";";
web.Update();
Is there something similar I can use to order the pages?
Set the Ordering to manual
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.orderingmethod.aspx
Check out the follow up article on this: http://www.thekickboard.com/archive/2010/09/01/programmatically-setting-navigation-order-in-a-moss-publishing-site.aspx
Is this sort of what you are looking for:
http://www.thekickboard.com/archive/2010/09/01/programmatically-setting-navigation-order-in-a-moss-publishing-site.aspx