Copied to clipboard

Flag this post as spam?

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


  • Sha Le 20 posts 40 karma points
    Jan 30, 2012 @ 15:36
    Sha Le
    0

    Editing text in user control

    Hi All -- Wrote a small registrion user control. What is the best way to edit the text in the user control by "Editor" user? Thanks.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 30, 2012 @ 16:21
    Jan Skovgaard
    0

    Hi Sha Le

    I asume you're thinking about how to modify the text in the user control you have created? You should be able to edit it using Visual Studio and if you're just modifying the .ascx file it should not be neccessary to do a build. Simply just copy over the file to whereever you need it.

    Hope this helps - otherwise please ellaborate a bit more :)

    /Jan

  • awm 187 posts 376 karma points
    Jan 30, 2012 @ 16:33
    awm
    0

    If you're wanting to allow a user to edit the data in a usercontrol, I guess you could have a document type with say a field called "usercontrolContent" and then pull this field from the backend of the usercontrol using the umbraco API?

  • Sha Le 20 posts 40 karma points
    Jan 30, 2012 @ 17:30
    Sha Le
    0

    @Jan, I meant the text in the user control page....(yes...I can edit since I created this user control, but I want the site editor to handle this).

    Details:

    1. I have a generic registration user control. This user control will be used by the site editors at various places based on their requirement.
    2. They want to customize some or all the labels of this form.
    3. I don't want to be an bottleneck to change label (since I am a developer)
    4. Also I don't want to create copy/paste this component just for label changes.
    5. This is a simple form and this site is for a non-profit and they don't need any fancy more than that...
    My options are:
    1. Provide a setter for each label, so when they add they could change the label name.(Kinda @alimac's approach above)
    2. Provide a template, so they can change it...programmatically I could read that document node in the user control, and render it.
    Any other options, thoughts?
    Thanks.
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 30, 2012 @ 18:24
    Jan Skovgaard
    0

    Hi Sha Le

    Yes, I can understand that - sorry for misunderstanding your initial post. #h5is :)

    In the scenario you describe above I see this as a maro that can be inserted a different pages through the rich text editor. And I think the best option is to have the label text set as parameters on the macro so the parameters are passed to the user control.

    When you have created a macro in the developer section you can click on it and go to the "parameters" tab where you can add the desired parameters. Define their alias (what you will refer in the user control) and friendly name (dispayed when inserting the macro) and then set the type to "text".

    This video shows you how it's done :) http://umbraco.com/help-and-support/video-tutorials/introduction-to-umbraco/developer-introduction/macro-parameters/TVPlayer

    Hope this helps.

    /Jan

  • Sha Le 20 posts 40 karma points
    Jan 31, 2012 @ 01:06
    Sha Le
    0

    Great! Thx Jan.

Please Sign in or register to post replies

Write your reply to:

Draft