Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jan 54 posts 74 karma points
    Jul 07, 2010 @ 12:39
    Jan
    0

    can you set a page to auto publish?

    i need to get the content of a page to always publish.

    there is a usercontrol with some radio buttons and a submit button . when this submit button is pressed the page gets its property changed. but it doesent update - since you need to publish the site first!

    big problem !

    what can be done ?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jul 07, 2010 @ 12:51
    Matt Brailsford
    0

    You can use the Umbraco API within the button handler? Checkout the following wiki page for modifying and publishing a page via the API

    http://umbraco.org/documentation/books/api-cheatsheet/modifying-document-values

    Matt

  • Jan 54 posts 74 karma points
    Jul 07, 2010 @ 13:10
    Jan
    0

    ok i messed it up -

    the usercontrol updates fine -

    but i have a macro that pulls out the info from the properties on the pages - but it doesent update untill i publish ??

     

    <xsl:template match="/">

    <!-- The fun starts here -->
    <xsl:variable name="voteNodes" select="umbraco.library:GetXmlNodeById(1363)/node[not(data[@alias = 'umbracoNaviHide'] = 1)]" />

    <xsl:value-of select="sum($voteNodes/data[@alias = 'votes'])" /> har stemt totalt


    </xsl:template>

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jul 07, 2010 @ 13:15
    Matt Brailsford
    0

    in your user control, define a click handler (or some other handler when the user interacts) and just tell it to update the page?

    public void btnSubmit_Click(object sender, EventArgs e)
    {
    // Do your thing here...

    Document doc = new Document(Node.GetCurrent().Id);
    doc.getProperty("votes").Value = Convert.ToInt32(doc.getProperty("votes").Value) + 1;
    doc.Publish(User.GetUser(0)); umbraco.library.PublishSingleNode(doc.Id);
    }

    Matt

  • Jan 54 posts 74 karma points
    Jul 07, 2010 @ 13:49
    Jan
    0

    urgh - im terrible at spelling out my problem :D

    ok i am using this here package - http://our.umbraco.org/projects/website-utilities/poll

    this poll works as it is intended.

    but unfortunately it diddent have a "toal number of votes"

    i made a that macro there to pull out all votes from pages in the poll. and add them together. - which works

    but for some reason it doesent update when the poll does? - the properties do get filled with new data when submit is hit - but the macro i made doesent collect new data

    that is my problem

    I am unable to get to the backend code of the poll  - hence i made the macro - which seemed to work - untill i noticed the macro diddent update on page refresh ?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jul 07, 2010 @ 13:56
    Matt Brailsford
    0

    Ahhh, ok, I don't know too much about the poll package. But I'd make sure you have all caching turned off on your macro. This should force your macro to re-render on every page load, therfore it should retreive fresh data.

    Matt

  • Jan 54 posts 74 karma points
    Jul 07, 2010 @ 14:13
    Jan
    0

    hm ok where can i set the caching ?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jul 07, 2010 @ 14:22
    Matt Brailsford
    0

    Go to Developer > Macros > Your Macro and ensure, cache period is 0, and cache by page, and cache personalized are unchecked.

    Matt

  • Jan 54 posts 74 karma points
    Jul 07, 2010 @ 14:38
    Jan
    0

    hmm unfortunately that diddent do anything :(

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jul 07, 2010 @ 23:12
    Matt Brailsford
    0

    Hi Jan,

    Hmmm, I'm not entirley sure then. Your best bet might be to request help in the packages support forum:

    http://our.umbraco.org/projects/website-utilities/poll/help-using-the-poll

    Many thanks

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft