How to pass dynamic multiple parameters in web.sitemap? - query-string

I have one page like (test.aspx) now i want to set its URL and Title in site map but the problem is that the same page (test.aspx) is calling from more then two place or links.Now i want to set Title and URL with multiple dynamic generated query string.But it is not allowing me to set multiple URL having dynamic parameters with different Titles.
Suppose, If test.aspx is calling from two places:
Home > Product > Test (Test.aspx)
Home > Price > Test Page (Test.aspx)
Now, Here The same page is calling from two places one is from Product and the other one is from Price. It should display as above in Breadcrumbs.

You can use the same page but with different query parameters. If you have test.aspx that needs to be called from two different places, here's how you need to frame your sitemap.
<siteMapNode url="~/Test.aspx?Parm=Product" title="Home-Product-Test.." ../>
<siteMapNode url="~/Test.aspx?Parm=Price" title="Home-Price-Test.." ../>

Related

How to implement SiteCatalyst inbuilt variable 'pageType' in DTM?

I am trying to implement SiteCatalyst's inbuilt variable 's.pageType' using DTM (which we use to capture the 404 error pages).
I can definitely write this piece of code in DTM's s.code:
s.pageType="errorPage"
But the problem is the condition which would identify if the page is 404 error page or not, can be identified only at page code level (as per developers, there are exceptions which is thrown if error page comes up, which can be used to identify this condition on the page), but this logic we cannot be used in DTM. Along with this, on the 404 error page, the pageName variable should not be populated.
How this can be done, since I am fetching pageName from a data element in DTM (inside "Pageviews & Content" section) which would always fire on every page.
How to implement this, please help me out. Am I missing something ?
Thanks,
Adi
It sounds like your setup is like this:
<dtm header tag>
// code that identifies 404 page
<dtm footer tag>
And it sounds like the issue is that since data elements are the first thing evaluated up in DTM top tag, your page name data element is being evaluated before it is known that it is a 404 page.
What I would do is in the code that identifies that it is a 404 page, make it output a global js var that flags the page as a 404 page, e.g. window.is404Page=true;.
From here, the overall goal now is to keep your existing data element and pageName assignment as-is, but then later override it with an empty string (and pop pageType instead). You didn't really give any details about where you are actually setting pageName, so here are some scenarios that should point you in the right direction:
Scenario 1: pageName is set in Pageviews & Content in the main tool config
1.a: In Library Management, if you have set AA to load at Page Bottom, then go to Customize Page Code section, make sure it's set to execute "after UI Sttings" (If you are already using this code box and it must be set to execute before UI settings, then skip this and go to 1.b). Click on Open Editor and add the following:
if (window.is404Page) {
s.pageName='';
s.pageType='errorPage';
}
1.b: In Library Management, if you have set AA to load at Page Top, then you will need to create a page load rule (or use an existing rule that will trigger on every page view) that evaluates at page bottom, on dom ready, or onload (basically anything but top of page - point here is to get it to eval after is404Page has been set). Within the rule, go to Adobe Analytics > Custom Page Code and add the code from 1.a there.
Scenario 2: pageName is set within a page load rule
If your page load rule is set to trigger at "Top of Page" then you will need to create a separate rule that triggers after that. See 1.b.
2.a: If you are setting pageName from within the DTM field using %dataElement% syntax, then add the code from 1.a to the Custom Page Code section.
2.b: If you are setting pageName from within the Custom Page Code section, using e.g. s.pageName=_satellite.getVar('dataElement'); then simply add the code from 1.a directly below it.
TL;DR: set a global js var to act as a flag in your on-page code that determines if 404 page and then look for that in your DTM code to overwrite pageName and write pageType in DTM custom code sections that get eval'd after the js flag var is set.

How to change URL of a page on button click and change the Keywords & Description of a page in asp.net?

I have a .aspx page which show items hierarchically(4Levels) depending on selected category(Level1). I want to change the URL on button click of specific Hierarchy say Level1, Level2, Level3, Level4 and accordingly change the Keywords & Description of a page depending on Clicked Item of specific Level.
Similar to this link
Eg:
When we click on CellPhones it shows different keywords & description in meta tag
When we click on CellPhones->BlackBerry-> it shows its related keyword & description in meta. And most important is the URL also changes at every CLICK.
Please can any one suggest me to do the same in asp.net.
Note: I am using Visual Studio 2008 Framework 3.5
Try looking at the History API (part of HTML5 so it works in all modern browsers) - specifically history.pushState().
http://html5doctor.com/history-api/
Example: http://html5doctor.com/demos/history/
Good luck.

Default.ctp and a totally different login page

Within my default.ctp page I keep navigational and structural content applicable to the entire application. For example menu structures and a column based CSS. I would like to change my login page, however, to look entirely different (no menu, no columns, etc)
Is there a way to load a separate ctp file for a single URL only? e.g. /plugin/controller/login
http://book.cakephp.org/2.0/en/views.html
You can create a new layout for the login page and for that controller/action change the layout name
$this->layout = 'login';
There are two ways. First, you create your new layout file, à la login.ctp inside your View/Layout folder.
Next, in your login action, at the top you can write $this->layout = "login";. The other way you can do it is when you render the view, at the end of your action method, like this: $this->render('actionName', 'login');

Custom Page tagging in Google Analytics

I want to have custom page tags, which are different from URLs I have, in my Google Analytics report page.
For instance,
Actual URL : /news/today_news.php
Page tag on Google Analytics : /news/today_news.php/Category.News/TodayNews
How can I make the custom page tag with Google Analytics Data Collection API?
There are several straightforward ways to do this (change the GA default name for a given page on your GA-tracked Site).
I. Passing the custom name in as a parameter to "_trackPageview"
This is probably the most common way to do this and probably the most straightforward.
The primary GA Method, _trackPageview, is usually called without passing in any parameters, i.e., pageTracker._trackPageview().
You can however, pass in a string for the name you wish to use for that page. In other words, find the call to _trackPageview on each page whose name you wish to change and insert your new name as a string between the parentheses, e.g.,
pageTracker._trackPageview("the_new_name_for_this_page");
Strictly speaking, the parameter you pass in actually changes the Request URI value to the string you passed in.
To verify: open the relevant Profile in your GA account, then click "Content" in the left-hand side menu, then "Top Content." This will cause a Table to render in the main viewing window of the GA Browser. The left-most column of that Table displays the Page (actually the Request URI). Check the contents of this column for your re-named pages.
GA uses two ways to identify pages in their Reports under the "Content" rubric--by Request URI and by Page Title. The Table displayed when you click on "Top Content" for instance, shows the former in the left-most column (the column is named "Page.") On the other hand, the Table displayed when you click the Report just below "Top Content", which is "Content by Title", shows pages by their title ("Page Title" is the left-most column header). "Page Title" here just refers to whatever appears between the title tag in the head of your page. In other words, the two techniques i just mentioned will not affect the Page's Title (the report "Content by Title" will not be changed).
II. Use a "Filter"
For instance, GA has a custom filter type called a "search and replace" filter, which is probably the best option among the GA filter types. The advantage of this techniques is that it doesn't require any code in the page.
Click "Analytics Settings" > "Profile Settings" (top left in the orange navigation bar), then scroll until you see "Filters Applied to this Profile"; click "+ Add Filter" to the far right. Because each filter type (pre-defined versus custom, which in turn is comprised of six different filter types) is set differently, it's probably best if i just refer you to a relevant GA resource.
III. Use "Custom Variables"
This is technique requires the most effort (though it's still not difficult); it's also the most sophisticated of the three techniques; for instance, using CVs you can re-map a given page to more than one name, which is useful when you want to group your content hierarchically. So for instance, you might wish give a particular page in your e-commerce Site three labels, to describe merchandise category, sex, and Brand, e.g., "Footwear", "Men's", and "Teva", or "Footwear/Mens/Teva". So for instance,
pageTracker._setCustomVar(
1, // 'Index' for this CV (an integer, 1-5)
"MerchandiseCategory", // 'Name' for this CV
"Footwear", // 'Value'--set upon call to _trackPageview
3, // 'Scope' an integer, 1-3, use '3' here because
// i have scoped this particular CV to 'page level'
// (1 and 2 are for visitor and session, respectively)
)
The code above initializes the CV, so it needs to be placed before your call to _trackPageview, because it's that call that sets the value of this variable.
After you've done this, and data has been recorded for your CVs, then you can begin using them. Remember, CVs are not Reports per se, rather than are indeed 'variables' which is much better because you can use them to create any reports you wish through the "Custom Reporting" feature in GA.
For instance, click "Custom Reporting" in the middle of the left-hand navigation panel in the GA Browser (once you have selected a particular profile). Then click "Custom Reports" then "+ Create new custom report" in the top right hand corner. Now click "Dimensions", the green navigation 'button' on the left-hand side, then click "Visitors." Scroll through the values for the 'Visitor' Dimension, and near the end of the list you will see additional values reserved for Custom Variables. If for instance, you had defined a CV called "Visitor Type" with possible values of "RegisteredUser" and "Prospect", that CV would show up here and therefore be available for you to use to create Custom Reports.
Here's what i believe is the Google Analytics Team's most useful explanation of Custom Variables.
And here is an excellent Blog post from a GA Consultant on CVs.

How do I customize the print layout of a SharePoint list item?

i need to be able to produce a "pretty" printout of an individual list item's values, with the goals being:
get rid of all navigation
organize data as it would appear on a typical paper form (a customer requirement)
i'm avoiding using InfoPath at this time due to other issues (which i'll post separate questions for...)
for example, i have an individual list item that normally displays similar to the following DispForm.aspx example:
i need a printed version (PrintForm.aspx??) that will display similar to the following example:
from what i can tell, i can't do this just by modifying/creating custom CSS.
it also seems that i can't quite do this just by creating my own "print" version of DispForm.aspx.
any suggestions, ideas, links would be very helpful.
Creating a custom list form is probably what you want. Without the master page attached to it or anything.
You can find a walkthrough here that will get you started:
http://office.microsoft.com/en-us/sharepointdesigner/HA101191111033.aspx
Enjoy.
You could use CSS to hide all the navigation etc. that you don't need using a media="print" stylesheet, but you won't be able to make the exact changes to the layout you've illustrated.
If it doesn't have to be exactly like the example, it would be fairly trivial to hide all but the name->value table and just print that. If you really do need to merge fields and re-layout the table then you likely have to hack up the server-side.
Why can't you create your own version of the page?
Using Sharepoint Designer, you could create a custom aspx page that uses a dataview webpart to do this...
#mortenbpost's link was just what i needed:
Create a new page that contains a custom list form
specifically, here's what you need to do to get a "basic" custom page for a list item -- from which you can completely customize it with XHTML/CSS:
first
ensure your list has all the columns you'll need
second
here's how to create a custom "view" page (virtually the same steps can be followed for a custom "new" or custom "edit" page):
Open MS Office SharePoint Designer
File -> Open Site...
enter your web-site URL
Make sure the "Folder List" Task Pane is visible (Task Panes -> Folder List)
Expand the "Lists" folder
You should see entries like the following:
Announcements
Calendar
...
YOUR LIST NAME
...
Expand the entry with YOUR LIST NAME
You should see entries like the following
Attachments
Items
AllItems.aspx
DispForm.aspx
EditForm.aspx
NewForm.aspx
Right-Click on YOUR LIST NAME
Select New -> ASPX
Re-name the file to something meaningful, like: PrintForm.aspx
Open PrintForm.aspx
View in "Split" mode
In the Code pane, you should see your insert-point inside a blank html form
Insert -> SharePoint Controls -> Custom List Form...
Select YOUR LIST NAME from the first drop-down (List or document library to use for form)
Select "Item" from the second drop-down (Content type to use for form)
Select "Display item form (used to view list items)" (this is where you choose between view, new, edit)
Un-check "Show standard toolbar" when creating a printable form
Click OK
In the Design pane, you should see a basic table layout with labels on the left and values on the right
In the Code pane, you should see such code as the following for every Column in your list (this one's for a "Single line of text" column type):
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>Column name</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="#Column_x0020_name"/>
</td>
</tr>
You can now just take all those <xsl:value-of select="#Column_x0020_name"/> entries and do standard XHTML/CSS layout
To test, save your work
Then, in a web browser, navigate to your SharePoint web-site
Select an item you've already entered data for
Choose "View Item"
In the address bar, replace DispForm.aspx with PrintForm.aspx
some things to keep in mind:
spaces and punctuation characters make for annoying naming of Column name
Column name in the code will have a maximum length of 32 -- any names longer will be truncated, e.g.:
SharePoint Column name: this is a long name
becomes in the code: this_x0020_is_x0020_a_x0020_long
any Column name in the code that would be a duplicate will be length 32 plus a numeric suffix. so, given the above column also exists, we would then have e.g.:
SharePoint Column name: this is a long name also
becomes in the code: this_x0020_is_x0020_a_x0020_long0
if you add columns or modify columns, you'll have to add them in by hand to this page
(do the Insert -> SharePoint Controls -> Custom List Form... on another "dummy" page to get the naming right)
again, i couldn't have done this without #mortenbpost's answer!
*****You can now just take all those entries and do standard XHTML/CSS layout *****
can you expand this with an example on how to do it?
This isn't an answer so much as a note to the above.
Use a custom list form but keep in mind that if any of the columns have versioning turned on you will not be able to get at the "data" easily. For example if one of your colums is a Notes column and everytime someone edits the notes field a new version is appended then none of that is accessible as it's essentially a seperate "list." I'm stuck on this issue as I also have a client asking for a print out which "doesn't look like it's from SharePoint."
Alternatively, you could export to a spreadsheet & print from there.

Resources