Yes - you can either apply the filter to the sectionNode variable, or you can set the filter in the for-each - depends on where you think it makes sense to "read" that these are filtered nodes.
Just a quick one, thats all working now but we need to compare the values of the memberID and venueOwner in a usercontrol update form. If the values are the same then display the panel with the form fields.
We can get the current value of the venueOwner: var vo = currentPage.GetProperty("venueOwner");
Whats the best way to compare the venueOwner and the CurrentMemberID in order to display the panel?
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using umbraco.NodeFactory; using umbraco.cms.businesslogic.web; using umbraco.businesslogic;
public partial class UserControls_UpdateVenue : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) {
// populate the text fields Node currentPage = Node.GetCurrent(); pageName.Text = currentPage.Name; bodyText.Text = currentPage.GetProperty("bodyText").Value;
List pages where memberID = memberID
Hi,
I have a group of members that once logged in, need to be able to see a list of pages based on their logged in memberID.
The document type has a property 'venueOwner' of the type member picker.
I just need to be able to list all the pages (venue, children of venues node) that match the memberID to venueOwner
(i think i need to have a filter on the sectionNode variable?)
<xsl:template match="/">
<xsl:variable name="sectionNode" select="$currentPage/ancestor-or-self::*/Venues/Venue"/>
<!-- The fun starts here -->
<ul>
<xsl:for-each select="$sectionNode">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
Hi Roger,
Yes - you can either apply the filter to the sectionNode variable, or you can set the filter in the for-each - depends on where you think it makes sense to "read" that these are filtered nodes.
Something along the lines of:
/Chriztian
Thats exactly what we have. Works great now, thanks for reply :)
Hi Chriztian,
Just a quick one, thats all working now but we need to compare the values of the memberID and venueOwner in a usercontrol update form. If the values are the same then display the panel with the form fields.
We can get the current value of the venueOwner: var vo = currentPage.GetProperty("venueOwner");
Whats the best way to compare the venueOwner and the CurrentMemberID in order to display the panel?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using umbraco.NodeFactory;
using umbraco.cms.businesslogic.web;
using umbraco.businesslogic;
public partial class UserControls_UpdateVenue : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// populate the text fields
Node currentPage = Node.GetCurrent();
pageName.Text = currentPage.Name;
bodyText.Text = currentPage.GetProperty("bodyText").Value;
var vo = currentPage.GetProperty("venueOwner");
}
}
protected void update_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
// Get the Document object via the nodefactory
Document currentPage = new Document(Node.GetCurrent().Id);
// Update the name of the page (text property)
currentPage.Text = pageName.Text;
// Update the bodyText property
currentPage.getProperty("bodyText").Value = bodyText.Text;
// Publish
currentPage.Publish(currentPage.User);
// Refresh runtime cache
umbraco.library.PublishSingleNode(currentPage.Id);
// redirect
Response.Redirect(umbraco.library.NiceUrl(currentPage.Id), true);
}
}
}
is working on a reply...