Creating custom URLs with TYPO3, RealURL and tt_news - url

Im still not understanding very well how the configuration of RealURL works. So far Im getting my news with this format:
http://www.mysite.com/games/detail/date/2012/01/01/game-1/
But Id like it to be able to customize the URL as I want, like:
http://www.mysite.com/games/WhateverIwanthere/
I have a page with the LIST view (id=3) and a child page with the SINGLE view (id=13)
This is my realurl_autoconf.php: http://pastebin.com/31s9uZDb

Get rid date params from your tt_news links see tt_news docs and find Settings for Links section
Put LIST view and SINGLE view on the same page and switch the views with TypoScript (there are snippets in the net so I don't writ it here)
Use fixedPostVars of RealURL to avoid redundant 'detail' word
With this scenario you'll be able to display:
http://domain.tld/games/ - LIST view
http://domain.tld/games/one-two-three/ - SINGLE view of One Two Three game

Related

Add page content dynamically MVC 5

I need to build a manage environment for my users so they could create new views (to give a title, a category, and the main content) or edit the content of the views that already have been created. I need to store this information in a database and have it appear in my site. I search through the internet but I didn't find a solution. I need this because I would like my site to have searchable content and because I have to many pages. Is that possible to achieve with MVC?
first step
Save view content as string using a wysiwyg editor, I recomend
http://summernote.org/
You need show your html using Html.raw() :
Exemple: Html.Raw("<div class=\"resource-row\">")
that way you will show your string as HTML.
I hope it is useful

How to accomplish this MVC layout

Being relatively new to MVC I have been struggling for the past several weeks getting my layout to work.
I have managed to get myself really twisted into knots. So instead of trying to explain and unravel my mess perhaps instead someone could explain how I would accomplish the following at a high level.
_Layout this would have all the css js etc. It would also have basic structure.
Of course HTML tags not allowed in code block....each render is in a div.
#RenderPartial(Header)</div>
#RenderBody()</div>
#RenderPartial(Footer)</div>
RenderBody is Index.cshtml and it would be broken into three pieces
#
#Html.Partial(NavMenu, model)</div>
#Html.Partial(SubNavMenu, model)</div>
#Html.Partial(MainContent, model)</div>
I have this basic layout and it looks fine until you click one of the menu items.
The menu items render as:
<a class="k-link" href="/stuffroute">Stuff</a>
That route goes to a controller that returns a view and that navigates away from the above arrangement in Index.cshtml. So I end up with the header, footer, and subdash nav....
So the question is...
How do I route / orchestrate my layout to not lose the differing pieces?
Partials don't do anything for you here. You're essentially asking about how to create SPA (single page application), although in this case your application will have other pages, it's just that the index view will act like a SPA.
That requires JavaScript, specifically AJAX, to make requests to endpoints that will return HTML fragments you can use to replace portions of the DOM with. For example, clicking "Stuff 1" causes an AJAX request to be made to the URL that routes to FooController.GetSubNav([stuff identifier]). That action then would use what was passed to it to retrieve the correct sub-nav and return a partial view that renders that sub-nav. Your AJAX callback will then take this response, select a portion of the DOM (specifically the parent of the sub-nav) and insert the new HTML as its innerHTML.
If you're going to be doing a lot of this, you'll want to make use of some client-side MVC-style JavaScript library, like Angular for example. These make it trivial to wire everything up.

Generate a dynamic table of contents based on (already) rendered headings with Rails

Many Wikis have it, a table of contents based on the headings from the displayed page. I'm looking for an easy possibility to realize that with Rails.
I have different kinds of pages, like dynamically generated ones, processed markdown pages as well as static pages. All these pages have HTML headings on different levels. How can I generate a Wiki like table of contents, which links to the headings with anchors?
I already searched for a post render callback or another entry point in the life cycle, which is happening after rendering, but I didn't found really one. What would you suggest to do? .. implementing a middle ware or what would be your direction?
If you decide to stick with markdown for all your content, you can do this with the Redcarpet gem. Passing with_toc_data: true to the renderer will add anchors to header tags. And re-rendering with Redcarpet::Render::HTML_TOC will generate a list of links linking to those header tags.

How to display a different breadcrumb title for the same controller + action method?

I have a Home controller and a Business controller. The business controller has a few action methods on it: Search, Create, Update, Delete.
On my home page I have links to the Search and Create views on the Business controller. The Search view also has a link to the Create view.
I want the bread crumb to look like the following when Create is accessed from the home page:
Home > Create
…and i want it to look like the following when Create is accessed from the Search page:
Home > Business > Create
In both the cases the controller/action method is the same, but the breadcrumb I want displayed is different. Is it possible to do this using MvcSiteMapProvider?
As far as I know this is not supported out of the box. Meaning that you have to adapt the HtmlHelper template to you needs, see https://github.com/maartenba/MvcSiteMapProvider/wiki/HtmlHelper-functions.
The only way this can be done is if you add some information to your route to tell one request apart from the other, then you can configure 2 different nodes to create both breadcrumb trails.
I have a working example of how to do that on my blog: http://www.shiningtreasures.com/post/2013/08/10/mvcsitemapprovider-4-seo-features#canonical-tag. Make sure to check out the code download.

How can I remove body from a Page in OrchardCMS?

I currently have 2 page types in my Orchard CMS setup. One is for the front page, one for a detail page. On the front page, I have removed the body from being displayed, so that it just shows 2 HTML widgets.
Is there a way so that when someone edits this page, they don't get a body section?
A placement file might also do the trick: placement also works for the admin ui... That could enable you to make it show or not without requiring two different content types.
You can remove the Body Part from the page content type you use for the front page. This way people who edit this page won't see the editor for body content and the body won't be rendered at all.
HTH

Resources