Force Umbraco to set Home.aspx as the default document? - umbraco

I am desperately looking for a way to force (or even hack) Umbraco to set the default document to Content/Pages/Home.aspx, instead of the first page.
(Currently I created a dummy page that redirects to Home.aspx as the first page under Content - but it is not ideal especially for SEO)

This is easy to do, add a new field to your existing/current default document called 'umbracoInternalRedirectId', of type 'content-picker.'
While editing the content for that page, choose the contentpicker and point it to the page you want to be the default document and save/publish and you should be good to go.

Related

jquery tablesorter issue with page number

I am developing an ASP.NET MVC 4 application using jquery.tablesorter.js, jquery.tablesorter.pager.js and jquery.tablesorter.widget.js. Now I get an issue with this tablesorter, that is, the page number is saved in the local storage.
I understand it is saved for some reasons. The problem is, for example, I last open the 3rd page of the table and leave the session, then re-open a session, it goes to the 3rd page automatically. If, for some reasons, there is not enough items for any item to go to the 3rd page, it simply shows an empty table and pager, and confuses the user.
Any idea is highly appreciated.
Thanks,
A. Zhang
If you don't want the pager to save the page & size, then set the savePages option to false.
If you do want the page to get saved, but you only want to use session storage, then set the storage_useSessionStorage widget option to true.
Please note: the above options only work with my fork of tablesorter.

How can I load a static page to a second address?

I have two production rails apps at http://www.firstapp.com and https://www.secondapp.com
I want to create a new static page, https://www.secondapp.com/static_pages/about, and I want its content to reflect what already exists at http://www.firstapp.com/static_pages/about.
Is there an easy way for me to do this? I don't want to have to reconstruct a page I've already created in firstapp. Also, I would prefer to be able to dynamically update the about page in secondapp just by editing the corresponding page in firstapp.
if you want the whole static page to be identical, then this is not a rails issue, that is what redirects are for. set a rule in your webserver configuration to point
https://www.secondapp.com/static_pages/about to http://www.firstapp.com/static_pages/about

already logged page should be display when open new tab in struts2

I developing Struts2 project.
In that project the user can log in and do something its work fine.
If that user open the new tab and type my project url it will show the same page(after login page).
How do I implement the above scenario?
One way would be doing like described here, in a question almost identical to your (concept is the same, only the implementation, on .NET, differs).
Calculate an unique value each time you pass in the Action, then put
it in a session variable (that is server side) and use it to feed an
hidden field on the web page (that is client side).
When the page will post back (submit) the form containing your hidden field, you
will see if the page field and the session field are the same.
If yes: it is (the only OR) the last page / tab opened.
If no: you are trying to submit the form from a page that is not the
last page opened.
This way, you will always have only one instance of the web application, and if you open another instance of the web application in a new page / tab, it will invalidate the previous one: only the last opened will be valid (because of multiple hidden fields, one for each page, but only one session variable).
IF you really need (do you?) to prevent the user opening a new tab instead of ensuring a single instance for the web-app, start working from this principle and eventually come back here (better with some code)

How to redirect user to the page they were just at without them noticing?

The website viewer would be at page A, click a link that sends then to page B, but I want them to return to page A without them noticing.
When they click the link it changes the layout the viewer is browsing the site with, so the redirection code shouldn't erase or undo the cookies or whatever are stored with the link click. Thanks!
Edit:
Here's what I'm doing. I have a page called setskin.php that has php code that takes header and footer codes for different layouts and applies them. I don't know how to show code without it going crazy, so there's a screenshot of it here:
http://figmint.uuuq.com/Picture%202.png
I want to change my website so that in a sidebar there will be the same setskin options (so it will be on every page). I was fiddling and managed to make it so when you click the link for the skin you want it changes the skin, but then you end up at the setskin.php page, which I don't want. I was looking for a way to make it so it sends you to the setskin.php page (since I couldn't see how to change that) and then back to where you came from.
You should use AJAX. That way you can do whatever processing is needed behind the scenes with zero impact on the user.
You can check the referer header and return to that. But if that isn't set go to a default page?
Other options include putting the previous url as a parameter, like a 'next' parameter. Then redirect to that after you're done. Quite common pattern used for login.

Creating custom content sections with umbraco

I'm working on an umbraco website just now and one of the requirements is to have a custom section in the back end that can be used to manage publish smaller micro-sites.
I have been able to create the new section and added some nodes to it. What I can't get to work is publishing them and making them viewable at the correct url.
As an example, say i have created a new section called microsite, inside that there is a folder called myportfolio. this should route to something like www.myumbracosite.com/microsite/myportfolio.
Does anyone know how to get this sort of thing working? Is it even possible to publish content from outsite of the main content section?
Any help would be greatly apprechiated.
Kind Regards
Colin G
From my understanding the custom sections are for linking to custom databases or data somewhere that needs an interface.
That said, you can use UrlRewriting and an existing content page with a macro to do something like that.
If you had a page called microsite, then using UrlRewriting you could make the parameter passed in to microsite.aspx (a content page in Umbraco) be "myportfolio".
With a user control on the microsite template it could display some content from your external database (or wherever your custom section stores it).
Not sure that's what you're looking for...
Why are you trying to create a new section for more content? The current Umbraco content area has all kinds of permissions for both users and members. Are the microsites all in the same install of Umbraco?
Another option is that the custom section could simply be used as a setup wizard for the new sites. You could create new content and users in their normal places and just use the new section to create them. It's not too hard to create content from C#, so it would probably be the same as doing it from a user control.
Could you provide a little more info?

Resources