1

Right now in our view we have something like this:

using (BeginRenderLink(x => x.ButtonLink, new { @class = "primary-button", style = style }, isEditable: true))
{
    @Editable(x => x.ButtonText)
}

We're currently linking to this view from a view rendering and the business has told me that they may want to occasionally add a Querystring parameter to the link and that the value may depend on several factors.

I'm considering changing the rendering to a controller so that I can change x.ButtonLink to include the query string parameters I want.

What I am concerned with is how to get this to play well with the experience editor. Am I going about this the wrong way? Is there a different method I should use that would serve this purpose better?

1 Answer 1

0

I think this is a good approach that you mentioned in the question. As far as I see you are using Glass Mapper, so this ButtonLink is a Link type where you can easily change the Query property in your Controller, like this:

model.ButtonLink.Query = "key=value";

Important to mention that with the approach above you overwrite the querystring which can be given by content editors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.