Accessing page metadata on a content web part to generate a custom link.

This is what I am trying to do in Sharepoint 2013...
Page1 has a metadata element which tags the page to a department (e.g. Finance, HR, Operations etc) and another element that tags the page to a location (NY, London, Brussels etc). On a new web part on the page I want to create a link to another page, Page2.
Through the link, I want to pass the value of these metadata elements to Page2. On Page2, through an onload JS function, I want to change the value of some field (text or dropdown etc) using the passed values.
I am having trouble figuring out a way to perform the page1 actions. I need to understand how to generate a URL based on the metadata elements, which will contain parameter values equal to these element values. I'd appreciate any help in understanding the
way to do this.
Regards,
VRA

Hi Vinay,
According to your description, my understanding is that you want to generate a URL which contains the tags of the page1.
I recommend to programmatically get the tags of the page1 in SharePoint first, please refer to the link below:
http://www.c-sharpcorner.com/uploadfile/anavijai/programmatically-get-all-the-social-tags-for-the-specified-url-in-sharepoint-2010/
After that, we can set the URL like this: http://server/pages/page2?department=Finance&location=NY. (Finance and NY are an example of the tags gotten programmatically)
Then we can pass the parameter values of the tags to page2 using JavaScript.
http://javascriptproductivity.blogspot.com/2013/02/get-url-variables-with-javascript.html
Best regards.
Thanks
Victoria Xia
TechNet Community Support

Similar Messages

  • How can we access Page metadata in DataView Webpart in SharePoint Designer 2013?

    Hi,
     I need to access Page metadata in my Data view web part and I am having a feeling, that the "Form" option can help me getting Page metadata, but I am not able to get much information about using this field as a parameter source on net? Can
    anybody advise, how to use "Form" option in "Parameter Source" in SharePoint Designer 2013
     OR Suggest me any other way to get Page metadata in Data View Webpart?
    Thanks in advance,
    Regards,
    Deepali
    Deepali

    Hi  Deepali,
    All the parameter source are ASP Request Object collections  which is used to get information from a visitor.  
    For accessing page metadata, you can select Server  Variable.
    For more information ,you can refer to the following article:
    http://www.w3schools.com/asp/asp_ref_request.asp
    http://blogs.msdn.com/b/spdsupport/archive/2008/07/25/data-view-data-form-parameters-you-don-t-know-about.aspx
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Table of Contents Web Part

    We have a website that builds a sitemap using the OOTB Table of Contents web part to build a Site Map. The site consists of several subsites and the site map is close but under one particular subsite though the site map shows duplicate links. As
    an example if you look in the page library you see page1.aspx, page2.aspx, page3.aspx and page4.aspx but on the sitemap page it displays:
    SubsiteName
    page1
    page2
    page3
    page4
    page2
    page1
    page3
    Page4
    The repitition isn't in any order either which i have tried to display in my example. Anyone else witnessed this? We have 5 different environments and all are affected in the same way.
    Thanks in advance

    hi
    good that you found workaround, but I would anyway add few words here which may help to troubleshoot original problem: in this case it is worth to check navigation settings of the problematic site. There may be some headings and links added manually, which
    cause this behavior.
    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

  • "Table of Contents" web part - How to have expand/collapse buttons? (I can use only CSS/JavaScript/JQuery)

    Hi there,
    I have a Table of Contents web part which is great. Is there a way so it shows only top level sites and then one can expand or collapse any top level site to see/hide the subsites?
    As of now it shows
    HR Parent site
    - HR sub site 1
    - HR sub site 2
    IT Parent site
    - IT sub site 1
    - IT sub site 2
    What I want is 
    + HR Parent site
    + IT Parent site
    So one can expand or collapse on demand.
    Any relevant JS/CSS/JQuery code?
    Thank you so much.

    Hi,
    According to your post, my understanding is that you want to expand or collapse the level site for the table of contents web part.
    I have made a simple code demo below to achieve this scenario, you can refer to it.
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function(){
    var iconCollapse = "/_layouts/images/collapse.gif";
    var iconExpand = "/_layouts/images/expand.gif";
    $("div[id='WebPartWPQ2'] li ul").hide();
    //ugly way
    var $t = $("#WebPartWPQ2 div").children("ul").children("li").children("div");
    $t.each(function(){
    //console.log($(this).html());
    $(this).attr("style", "float: right; margin-right: 297px; line-height: 8px;");
    $(this).css("display","inline");
    $("<a src=" + iconExpand + "></img>").insertBefore($(this));
    $("a[class='min']").click(function()
    var img = $(this).children();
    //Traverse the DOM to find the child UL node
    var subList = $(this).siblings().children('ul');
    //Check the visibility of the item and set the image
    var Visibility = subList.is(":visible")?img.attr('src',iconExpand):img.attr('src',iconCollapse);
    //Toggle the UL
    subList.slideToggle();
    </script>
    Note: Yous should change the Web part ID and the css style to fit your environment.
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Table of contents web part doesn't display all data

    Hi,
    We did a test migration from Sharepoint 2007 to SharePoint 2013. There is a Table of contents web part that is being used to display all of the team sites (more than 25). In the SharePoint 2013 version, the TOC web part is not displaying all of the sites.
    Any ideas of how to make it show all?
    thanks,
    Sherazad

    Hi Sherazad,
    According to your description, my understanding is that you want to display all sites in the Table Of Content web part.
    There is a limitation of the web part, the maximum number of the items displaying in the web part is 50. If you want to display more 50 items, you need to increase or remove the limitation. You need to go to the web.config file of the SharePpoint site, the
    path is C:\inetpub\wwwroot\wss\VirtualDirectories\port number, then find all navigation providers, and add
    DynamicChildLimit attribute to each one . More information, please refer to the link below:
    http://praveenbattula.blogspot.in/2010/11/table-of-contents-web-part-remove-max.html
    Note: before changing web.config, please make a backup for the file.
    After the above, if your issue still exists, please open your site->Site Settings->Navigation, change the value from 20 to [whatever number you want to display] in the “Current Navigation”section. More information,
    please refer to the link:
    http://www.chaitumadala.com/2010/05/sharepoint-2010-table-of-contents.html
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Hiding subsites in Table of Contents Web Part - SharePoint 2010

    I've gone through the normal steps of having the table of contents web part not show a subsite (uncheck the box that says "Show Hidden Sites" as well as hide the site in the global navigation) but for whatever reason, the site I've hidden still
    appears in the table of contents. Is there any way to remove it without deleting the subsite entirely?
    Thoughts?

    Actually, a version of Nate's solution did work for me, it just needs more details.....
    Where you need to check off "Show Subsites" is in the "Current Navigation" section of SiteSettings/Navigation, and then hide the sites from THERE in Navigation Editing and Sorting  (I had already tried it on the Global Navigation side
    and the subsites still appeared in the Table of Contents).  
    For our particular needs, we did NOT want those sites on this root site navigation sidebar as well, so after setting the specific subsites to "Hidden" and saving changes, I went back to SiteSettings/TreeView and unchecked "Enable Quick Launch".
     All appears on the Root Site TOC as desired.
    So, Nate was right about the whole counter-intuitive thing, but no need for custom css or de-activating/activating the publishing  features
    --VS

  • SharePoint 2013 Table of Contents Web Part

    I have upgraded to SharePoint 2013 and have a table of contents web part that is supposed to display 5 columns. Instead, it is displaying all the sites in one long vertical column. I found the PowerShell script to set the displaycolumns property on the
    web part. However, when I ran the script, this property was already set to 5, yet it is still only displaying one column. I tried adding another table of contents web part and setting the displaycolumns to 5, but that did not work either. How can I make
    this web part to display properly?

    Hi gmchusyr,
    What script did you use for this issue?
    Table of Contents web part's display column is removed from SharePoint 2013 version, it still display in SharePoint 2010.
    Please try to run the PowerShell commands in the TechNet blog below, compare the result.
    Table of Content Web Part: Slightly different in SharePoint 2013 / Online:
    http://social.technet.microsoft.com/wiki/contents/articles/28429.table-of-content-web-part-slightly-different-in-sharepoint-2013-online.aspx
    Best Regards,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Access denied error while adding visual web part

    i am trying to create visual web part using client side code in SharePoint 2013.
    i am able to deploy my web part but when I try to add it on a page it says " Access denied. You do not have permission to perform this action or access this resource" and when i try to debug it it shows exception: "The remote server returned
    an error: (500) Internal Server Error."
    Following is the code:
     protected void Page_Load(object sender, EventArgs e)
                var ClientContext = new ClientContext("http://172.20.30.100:1111/");
                        //SP.ClientContext.get_current();
                Web web = ClientContext.Web;
                ClientContext.Load<Web>(web);
                ClientContext.ExecuteQuery();
                var BU = web.Title;
                ListCollection ListColl = web.Lists;
                List list = ListColl.GetByTitle("LNT_Testimonial");
                CamlQuery CmlQry = new CamlQuery();
                CmlQry.ViewXml = @"<View>
                                        <Query>
                                          <Where>
                                            <Eq>
                                              <FieldRef Name='BU' />
                                              <Value Type='Text'>" + BU + @"</Value>
                                            </Eq>
                                          </Where>
                                        </Query>
                                        <RowLimit>1</RowLimit>
                                      </View>";
                Microsoft.SharePoint.Client.ListItemCollection items = list.GetItems(CmlQry);
                ClientContext.Load<ListCollection>(ListColl);
                ClientContext.Load<List>(list);
                ClientContext.Load<Microsoft.SharePoint.Client.ListItemCollection>(items);
                ClientContext.ExecuteQuery();
                //var testimonial = items.FieldValues["testimonial"];
                foreach (Microsoft.SharePoint.Client.ListItem item in items)
                    var testimonial = item.FieldValues["testimonial"];
    regards, Ritesh Anand

    I'm not sure if you are trying to create visual webpart or doing something else? As I understand from your code, maybe, you are trying to access list item. If you have access to the server (on-premise), you can check the ULS log for details of the error.
    Is it access denied or 'internal server errror'. If it's internal server error then more details can be found in SharePoint ULS log. About reporting service, not sure if it's related to your original question. Please try to use a single post to focus on single
    problem.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Pages have suddenly lost their web parts - false, false, 1

    Hi
    We have a new SP2013 setup and one of our new site collections has suddenly exhibited a problem whereby all the pages that previously had had a number of web parts defined on them - mainly document library views - have now changed to blank pages just
    displaying false, false, 1 instead of the web part content.
    I have no idea why this has suddenly happened. The only changes on this relatively little used system that I'm aware of are that our server team have recently installed the March and April updates.
    Has anyone else seen anything like this? Can anyone shed any light on this?
    Thanks

    I did install both the March PU and the Ocotber CU and on my Community-Site Page I still have the error:
    true,false,3
    No Webparts are shown.
    When I call the site with param:
    ?Contents=1
    I get my list of all the Webparts on the site, with Status still active. But I can´t get them back on the site. Does someone has an idea?
    PS:
    Seems there is a Problem with the Page Layout after update!
    Found this:
    Text Layout
    Header
    Footer
    Columns
    layoutsData
    Notes
    One column
    No
    No
    1
    false,false,1
    "margin: 0in 0in 0pt;">One column with sidebar
    No
    No
    2
    false,false,2
    The difference between this and the “Two columns” is in the % of column width each takes up.
    Two columns
    No
    No
    2
    false,false,2
    The difference between this and the “One column with sidebar” is in the % of column width each takes up.
    Two columns with header
    Yes
    No
    2
    true,false,2
    Two columns with header and footer
    Yes
    Yes
    2
    true,true,2
    Three columns
    No
    No
    3
    false,false,3
    Three columns with header
    Yes
    No
    3
    true,false,3
    Three columns with header and footer
    Yes
    Yes
    3
    true,true,3
    (List originated from:
    http://www.rdacorp.com/2012/02/no-code-wiki-page-provisioningwith-content/)
    So the update (may) change/break the layout of the aspx page!!
    Now I still Need a fix for that. I try changing the Layout from the acutal one column to my former Three Columns with Header Setting....

  • Content Search web part - Display Project Enterprise Custom Fields and Lookup Tables

    My ultimate goal is to display a rollup table of our active projects (from PWA) on another site collection using the content search web part. I can return default properties (such as the project name, author and URL) fairly easily using the same basic steps
    in the link below.
    http://en.share-gate.com/blog/roll-up-sharepoint-2013-sites-using-search
    My problem is that I want to also display information associated with each project from our PWA enterprise custom fields (such as risk, phase, etc.)
    Because these custom fields do not appear to be site columns, I'm at a bit of a loss as to how this data is searched / indexed / mapped.
    Is it possible to display PWA enterprise custom fields in a content search web part?

    Hi Jennifer,
    According to your description, my understanding is that you want to display PWA enterprise custom fields in a Content Search web part in SharePoint 2013.
    As your active projects were from different site collection with the Content Search web part, you need to do a crawl for the content source, then create a managed property for the column in CA->Search Service Application->Search Schema. When you create
    the managed property, select Searchable, Queryable, Retrievable.  Then  map it to the crawled property based on the custom column. You can find the crawled property by searching the name of the column in crawled properties.
    More information, please refer to the link:
    http://technet.microsoft.com/en-us/library/jj219667(v=office.15).aspx
    I hope this helps.
    Thanks,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • How to incorparate managed metadata functionality in a web part

    Hello,
    I'm writing a web part that manipulates a list's managed metadata field . I want to give to the users all the functionality that SharePoint gives, like realtime searching, the popup window to add a new term and so on.
    I was thinking of (somehow) hooking  the javascript code to my  field, but I don't know how.
    Is there another approach to do it?
    Thank you
    Christos

    Hi Chris,
    Are you looking for something like this
    http://www.myspblog.com/2011/05/managed-metadata-web-part.html
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Render html in the Business Data web part (used for the BCS profile page)

    I am searching and indexing a webservice and pulling in external content, through SharePoint's BCS. I have used SharePoint Designer to make the connection and its a read only connection, we are not trying to write back to the external data source. The problem
    I have is that some of the columns are rendering the HTML as a string, with all of the HTML tags. For example, a column will render like this:
    &lt;p&gt; Onboarding, Recruiting &amp;amp; Talent Acquisition general information&lt;/p&gt;
    The profile page uses the business data web part and will accept custom XSL and I have modified the column that is rendering the html from:
    <xsl:value-of select="@u_cause" /> 
    to
    <xsl:value-of disable-output-escaping="yes" select="@u_cause" /> 
    The problem is that it does not make a difference the column will still render the HTML. Is there any other way to make the column render HTML?
    Joe Garcia

    Hi,
    According to your description, my understanding is that you want to render column value as the HTML format in the xslt list view.
    I suggest you can set the “disable-output-escaping” attribute like below, it will render as html:
    <xsl:value-of select="@MyColumn" disable-output-escaping="yes"/>
    Here are some detailed articles for your reference:
    http://sharepoint.stackexchange.com/questions/16089/unescape-html-from-list-column
    http://doitwithsharepoint.blogspot.com/2011/06/sharepoint-list-forms-display-html.html
    Thanks
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jerry Guo
    TechNet Community Support

  • Using multiple refinement web parts on the same page but have them hidden until needed

    I have a search results page that has several different Core Results web parts on it (each is connected to a different result source). all hidden by tabs using the HillbillyTabs interface
    http://www.sharepointhillbilly.com/Lists/Posts/Post.aspx?ID=42
    unfortunately you cant share a refinement web part across multiple results web parts. So I am left trying to figure out how to hide several refinement web parts and only show the active refinement webpart when the result source tab is selected.
    The template im using is an OOTB standard search results template with the refinement panel on the left navigation zone and the core results web parts configured in the main content zone.
    Scenario:
    Search text box passes query to multiple results web parts on a page. Only one results web part is displayed at a time (active tab). The refiner for the active tab shows and displays its refiners in the navigation panel.
    There are multiple refinement web parts in the navigation panel associated with each core results web part in the main content zone. These refiner web parts are configured with custom refiners.
    the results page displays just one results web part at a time via tabbed interface.
    I am trying to figure out how to make the refiner web parts show and hide depending on which tab is selected.
    Any help pointing to someone thats already attempted this would be appreciated! 
    Eric

    Hi,
    For your issue, you can consider using SharePoint Search Navigation which can achieve a similar feature but not on the same page.
    Search Navigation allows users to move quickly between search experiences listed in the Navigation. Navigation is displayed in the Quick Launch control on search pages, and can also be shown as a drop-down menu from the search box.
    For more information, you can refer to the blog:
    http://blogs.technet.com/b/tothesharepoint/archive/2013/11/13/how-to-add-a-customized-search-vertical-to-your-search-results-page-in-sharepoint-2013.aspx
    Best Regards,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Files access report from List View Web Part

    Hi,
    I have a list,inside the list there are some folders and inside the folders there are some files.
    This list has been added to the aspx page as a list view web part.
    Now our requirement is to generate report on monthly basis of logged in user who accessed folders/files from the webpart.
    Is this possible through OOB/customisation please let me know.
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

    Hi, 
    Did you check this link? If not please refer it. They are talking exactly what do you want in your requirement. 
    http://office.microsoft.com/en-in/sharepoint-server-help/view-audit-log-reports-HA102039795.aspx
    Sekar - Our life is short, so help others to grow
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer

  • "Oslo.Master" set as the The default Master Page, but when record selected in "List View Web Part" page shifts to the right.

    Hi All,
    I have set "Oslo.Master" as the The default Master Page for the site.   I have a page with a List View web part and an InfoPath Web Part connected.  When the page loads is it displayed correctly.  However, when a record
    is selected and the infopath web part is updated, the content on the page shifts (indents) to the right.
    Is there something I am missing?   Does anyone know how to correct this?
    Thanks in Advance!

    Hi Dwayne,
    I could reproduce this, as a workaround, we can use javascript code as below to hide the element in the following image.
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script>
    $(document).ready(function(){
    $('#contentBox').prev().hide();
    </script>
    Thanks
    Daniel Yang
    TechNet Community Support

Maybe you are looking for