Looking for old forum posts and information? View the old forum archive here ยป
Welcome to Vortx Community Forum, where you can ask questions and receive answers from the staff at Vortx and other members of the community.

If you had a user account on our previous forums website, you will need to register a new account here.

A static copy of our previous forums website is available online for reference. Click here to access the forum archive.

Learn more about...


Account Page: Customize hyperlink by customer

On my site's Account page, I want to show a customized hyperlink that automatically logs a customer in to a different site (on a separate subdomain). I have the query parameter for each customer that will customize this link, and was hoping to simply add that to the table for each customer and then query for the info from the page (I've customized a few of the XML packages and Stored Procedures in the same way).

However, I'm realizing that the Account page doesn't work like this (.cshtml file vs. .xml file), and was wondering what's the simplest way to modify the Account page index.cshtml file in order to get the needed column from the dbo.Customer table for that customer so that I can then create the appropriate URL?
asked Feb 27, 2017 in MultiStore by jcarswell (180 points)

1 Answer

0 votes
Best answer

Views/Account/Index.cshtml is a View, which is only supposed to output information - it can't 'get the needed column' (at least if you're going to follow proper MVC methodology).  You would actually need to modify first the AccountIndexViewModel object to have a property for the value you want to display, and then the places that build that object to look up that data and set it on that new parameter.  Then you'll have @Model.WhateverYouCalledIt available to output in the .cshtml file.

That will of course require source code to do.  If you haven't purchased the source code there are ways around following the proper MVC patterns to output data, but they almost inevitably lead to bad development practices, vulnerabilities, hard to manage code, etc.  Learning MVC is the way to go to be able to make modifications properly in v10.

If all that sounds like a bit much, any of our DevNet partners could help with that kind of work.

answered Feb 28, 2017 by Vortx ScottS (13,500 points)
selected Feb 28, 2017 by jcarswell