My Blogger template (klarity) automatically adds my domain name infront of any link I want to add to my menu. For example: I want to create a link to my page 'about'. All I need to do is create a list item with a link pointing towards /about.html.
This is a problem when I want to link a menu item with an external domain. So if I want to create a link between the menu item 'shop' and www.myshop.com I cannot simply change the href of the link to www.myshop.com because blogger adds my domain name infront of it, making it look like: www.mydomain.com/www.myshop.com.
From what I understand Blogger does this through the following code: data:post.url or similar. I have looked for that kind of code and tried cutting it out but so far I have not managed to get rid of www.mydomain.com infront of every list item.
How can I remove www.mydomain.com from my menu items? This is the only solution I could think of, if there are any others please do suggest them!
So I actually figured out the problem, it was really easy:
Just change the link so that it looks like this:
My domain
Make sure you don't forget the http, otherwise you are going to get errors (thats's the mistake I made)
Related
This has been asked before but I'm going to be more precise with my question to hopefully get a better answer:
I have figured out how to add views to the PageNames class:
public const string WorkOrders = "WorkOrders";
and then to the projectNavigationProvider class to get them in to the navbar:
.AddItem(
new MenuItemDefinition(
PageNames.WorkOrders,
L("WorkOrders"),
url: "WorkOrders",
icon: "business",
requiredPermissionName: PermissionNames.Pages_WorkOrders
)
To get my main views added to the main navbar and working properly.
However, I have not figured out how to create a totally new menu to be used elsewhere. In the app I'm working on we have several pages that display all of the records in a particular table, Work Orders for example. But each record in each table should have several links to other pages for create, edit, details and delete.
One of my partners seems to have solved this problem on other pages by using modals and ajax calls to the controllers endpoints. It works fine for the Customers, which only require name and contact info., but I don't think a modal will work for creating, viewing or editing a Work Order becuse it requires adding line items and the associated data for each one of them etc... There's a lot to it. Lastly, it doesn't seem like the template is set up to be used that was as he wrote a lot of his own js to get it working.
Currently, the create, edit, and details views exist and I have links to them next to each record but I get errors when I try to use the link. Maybe I don't understand how the routing works? In the normal mvc template from VS the links have properties for specifying the controller and method and mvc handles the rest.
<a asp-action="Edit" asp-route-id="#item.WorkOrderID">Edit</a> |
<a asp-action="Details" asp-route-id="#item.WorkOrderID">Details</a> |
<a asp-action="Delete" asp-route-id="#item.WorkOrderID">Delete</a>
I'm getting the same error I had when trying to get the Work Orders page to load but had not added it to pagenames or navigationprovider, which makes me thing I just need to add the links to the navigationprovider class but I don't want a link the the WordOrders create page on the main menu, I want it on a mini menu next to the corresponding record. I have added the page to the pagenames class but am not sure how to create a separate menu for my main page.
public const string CreateWorkOrders = "CreateWorkOrders";
In reviewing the navigationprovider class I see:
context.Manager.MainMenu
and I'm thinking I must be able to create another menu and add items to it like this:
context.Manager.NewMenu.AddItem(....
but it looks like MainMenu is referenced in a class that I can't find or edit. Should I be creating another class defining the NewMenu so I would be able to configure it in the existing navigationprovider class or should I be creating a separate navigationprovider class for it?
Hopefully I've convinced everyone who looks at this that I have done plenty of research before reaching out for help. Even a link to some more detailed documentation would helpful.
You can add a new menu like this:
context.Manager.Menus.Add(WorkOrders, new MenuDefinition(WorkOrders, L(WorkOrders)));
Usage:
context.Manager.Menus[WorkOrders].AddItem(...)
This view suppose to show a list of hyperlinks, each pointing to an external URL. The goal is for the user to click one of these links and have their browser open a new tab with the selected URL.
Currently I have the following markup:
#Html.ActionLink("SomeSite", "http://subdomain.mydomain.com/SomeSite")
This markup produces:
http://localhost:58980/AccessInstance/http%3a/subdomain.mydomain.com/SomeSite
instead of :
http://subdomain.mydomain.com/SomeSite
What can I change in my markup to make this work as I expect?
You don't need to use #Html.ActionLink for that. Just use a plain A tag:
SomeSite
Html.ActionLink is specifically for generating links to actions defined in MVC controllers, in the same app. Since you're linking to an absolute URL, you don't need any of the functionality that Html.ActionLink provides.
Two ways :
1. update the database column with full link:
eg SQL:
update ProductTable set ProductLink='http://www.example.com/Product/Mobiles' where ID=123
In asp mvc view
View
2. Hardcode the http part and list from model
View
Hope helps someone.
While a ViewBag is overused and not the best choice most of the time this is something that I had done when inheriting someone else's mvc app to do a quick fix for a URL that I needed to redirect to with a specific dynamically changing querystring parameter
<a target="_parent" href="http://localhost:56332/services/#ViewBag.factory">View Service</a>
Using .NET Core 6
This seems to be the most correct answer:
Link
This will generate the following result:
As you can see at the bottom left corner of the window before clicking the link, the URL address was rendered as it is (NOTE: The cursor was recorded out of place for some reason, that's a ShareX problem, ignore it).
Than link will be directly saved as a nvarchar(750) type (probably any character like type will do the work). No changes to the original link were made before saving it or on reading:
You need to take into account your RouteConfiguration.
routes.MapRoute(
name: "Default",
url: "{controller}/{action}"
because you are specifying the action link as the entire link that you want to redirect.
I would recommend that you use the #rossipedia answer because you can make tricky things like putting a span inside the link
Here to display link that are clickable in index page
<td>
#Html.ActionLink(item.FileName, "../Uploads/Catalogue/"+item.FileName)
</td>
am developing an application in which i have to show the customer purchase details supplier wise. for that i have develop user control an add it on page. but the problem it that on user control i need to add a ling to promotional offer page for that supplier which show the current offers of the supplier. for that i have added the hyperlink as fallow to user control
<asp:HyperLink ID="PromoLink" runat="server">Have promo Code ?</asp:HyperLink>
and set the navigation URL as fallow
PromoLink.NavigateUrl = "Promotion.aspx?Filter=" + dt.Rows[0]["SuppId"].ToString();
but when page is load in does not render the navigation url to the link.
i donot why it does not render the url plz help to get out of this.
thanks in advance.
Make sure that the pathing is correct for the NavigateURL property. Try adding "~/" at the start of the NavigateURL or "../" if it is not in the same folder as the current file.
Make sure that the dt.Rows[0]["SuppId"] is actually getting the value that you expect.
Step through code in the debugger to verify that the Page_Load event that you are using is actually executing and modifying the value as you would expect it to.
Say I create an HTML file with two .page on it. In the first .page, I'd like to have a link to the second .page.
Is there a way to navigate between pages without having to write my own JS? This seems to suggest I do have to write JS: http://view.jquerymobile.com/1.3.2/dist/demos/widgets/navigation/.
However, I'd would rather set an id attribute for one of the pages, then maybe define some data attribute in the link to tell jQuery mobile where to go. Possible?
I'd also like to specify what kind of transition effect to use.
You can use standard anchor links, just give an id to your page and set the transition via the data attribute
Link to Page 2
2/28: Seems the Go uri is only if you create your own persisten layer. I'm going to try and use a link on my form to do this. If I can figure out how to find the form_id of the current form.
Original Question:
I'm trying to restrict who can delete a form instance. It seems if people can get to the form-runner summary page, they can click the delete button and delete a form (even if they are not allowed to do any "/orbeon/fr/hr/expense-report/edit/*" options.
Anyone found a way around this issue. I wonder if we could use the GO button on the form /edit/ view to build our own delete feature.
If I look at the page source from the hr/expense-report/edit/f36b446c3ddbf7c63ec033d5c6fa7ce4 view, that the from does have the details to the actual form instance.
Example:
form id="xforms-form" class="xforms-form xforms-initially-hidden xforms-layout-nospan" action="/orbeon/fr/Test/Hidden_Search/edit/f36b446c3ddbf7c63ec033d5c6fa7ce4"
I wonder if that information could be passed to the "GO" button, if I have that on my page?
Right now, if users can access the Form Runner summary page, they can also access the "delete" button. Showing the "delete" button on the summary page for some users but not others, requires a change to Form Runner, which shouldn't very complicated.
For instance, if you only want the "delete" button to be shown for users with the role can-delete, on this xforms:bind of fr/summary/view.xhtml add the attribute:
relevant="xxforms:is-user-in-role('can-delete')"