MvcSiteMap - https://github.com/maartenba/MvcSiteMapProvider [originally at: http://mvcsitemap.codeplex.com/]
Is it possible to create such links in a sitemap with MvcSitemap?
I can create a simple sitemap but not one with the link below..
www. ... .com / Eventname / groupID /Tasks/ Details/ taskID
Eventname, groupID, TaskID are dynamic.
If not is there another solution for my problem?
I know this answer comes a little late, but I've just picked up on MvcSitemap myself in the last week and am using it as per the OP's question in my own project.
It's certainly achievable. You can define sitemap nodes by creating a custom node provider, within which you pass in the route values for each node, based on the custom route you mentioned. Even version 1 of MvcSiteMap allowed for dynamic nodes, but v2.0 seems a lot more flexible - and it supports MVC2 Areas.
Have a look at the project wiki entry on defining sitemap nodes in code. The sample project is pretty good too. If you only have SQL Express installed, you may need to grab the DB files from the original MVCMusicStore project as the DB files included with the MvcSiteMap sample will only work on paid versions of SQL server.
Related
Let's say I have created a news portal bundle "NewsBundle" with articles, tags, events, lots of relations, quite huge and complex.
Now I want to copy this numerous times and create a Fashion News Portal, Car News Portal, Dog News portal and so on each available though an own domain. The portals differ only in templates, translations and assets. As I want to implement complex reporting, I want all the stuff in a single database and would flag all entities with the respective portal.
My question: How so I organize the code?
First I figured out, I could use routing to have the same application but different bundles for each domain.
Then I found out, that I could extend my master bundle. But it seems as this works only once.
As I did all the routing with annotations, it look like it does not work to inherit the routes from the master?
One of the hardest questions is where to put the portal switch. Somewhere I need to set a variable that tells whether its the fashion or dogs portal, so I can filter the content in all repositories accordingly.
I did that in the app.php which is for sure worst practise.
In the end I want to be able to roll out new portals easily without duplicate code.
Any ideas are much appreciated.
Greetings from Hamburg,
Boris
You need to keep your NewsBundle in your application, and to have a number of bundles revolving around it, one for each portal you intend to create.
There is no real need for bundle inheritance here. Your portal bundles depends on the NewsBundle but don't inherit from it.
Routing configuration, templating, and other behaviours related to a specific portal should go in the related bundle. There is a Resources folder in each bundle ; this is where you will need to put specific routing, translation, configuration and templates.
app/config/routing.yml is the central routing conf file where you will need to reference all other routing.yml file.
As for the switch, well, I can't answer that in detail but I think it should be set up in your server application apache or nginx (or other...).
Your problem can be solved via different environments. Each of your portal is a different environment. You can set up your web server to point different front-controllers depending on the domain requested.
Example:
For domain news.domain.com your front-controller would be web/app_news.php. And it will contain line:
$kernel = new AppKernel('news', false);
It will automatically load config from app/config/config_news.yml. In that config you can specify all specific parameters for your portal. You need then just implement your special loader for resources like translations that will load resources from the path specified in config_news.yml.
I am following these steps: https://documentation.magnolia-cms.com/display/DOCS/Creating+a+page+template. I'm stopped at creating a page definition.
Magnolia does not see my helloWorld.jsp template. I'm using the Enterprise Edition (free trial) if it matters. I watched all tutorials, but I can not find the answer.
Yes, it probably matters.
When you are using EE, you can have defined multiple sites in single server and you don't necessarily want to have each template available in each site you define. So you need to tell Magnolia for which site you want to enable this template. To enable this template for all sites, go to STK group in AdminCentral and open SiteDefinitons app there. In Site Definitions, go to /default/templates/availability/templates and register your template there by creating Node named helloWorld with property id set to value templating:pages/helloWorld (ID is always in format module-name:path-to-template-from-templates-folder)
HTH,
Jan
I'm trying to drop in ImageResizer to replace an existing system on an ASP.NET MVC site. Currently the site supports two similar URLs:
"/images/[GUID]"
and
"/images/$[GUID]"
These point to two different data sources. Currently one of these looks for the image data in an otherwise inaccessible folder while the other looks in a SQL database. Is there a way to dynamically change the source for the image data in the pipeline (to different folder or to the SQL provider)? By adding an event to the current pipeline's PostAuthorizeRequestStart I've been able to change some of the behavior, but I'm not sure how to alter the actual data source. Thanks
So I solved this using the Rewrite event handler and rewriting the prefix to match my source. Not sure if this is the best way, but it is working.
I just installed the ServiceStack NuGet package ServiceStack.Host.AspNet into an existing legacy VB.NET Web Forms site. After cleaning, then running the project I am being prompted with this text
Forbidden
Request.HttpMethod: GET
Request.PathInfo:
Request.QueryString: ReturnUrl=%2f
Request.RawUrl: /LoginPersonal.aspx?ReturnUrl=%2f
App.IsIntegratedPipeline: True
App.WebHostPhysicalPath: < Path to website >
App.WebHostRootFileNames: [ List of every file and folder in the root of the application]
App.DefaultRootFileName: default.htm
instead of my log-in page.
What is the best approach to slowly integrate SS into the site without breaking existing functionality, yet benefiting from SS Session, Cache, ORM, and Serialization?
UPDATE
The solution that ended up working was in the wiki all along, except it was missing the step about removing the original handler created by NuGet. I have since update the wiki to reflect this use case.
-Stephen
Have you added the custom path as per this wiki article?
I uploaded all the files of Umbraco CMS to the my http://blog.domain.com and also modified the web.config file. When I point to blog.domain.com, it is giving an error written in the subject. The hosting type for the subdomain is physical hosting not subdomain on subfolder
So, I have a second web.config file in this subdomain. The first one is in the main domain. I hoep this doesnt make a differnce.
Here's the screenshot: http://i.stack.imgur.com/PxSqq.jpg
I checked the database user with which I am trying to login in to the DB and it has the db_owner permissions for the database.
Also, I tried googling for the similar issues to see if someone with similar error had resolved the problem. Here are some pages but I haven't been able to find a solution.
Please help! This has been pending for long! :-(
When the Umbraco database is created, a new schema is created and all tables are created under this schema (eg. . rather than dbo.).
As the Umbraco website / db are copied, I assume that you changed the credentials, meaning the Umbraco data access layer may be trying to find tables ..
I have found that changing the schema to dbo resolves this problem and can be achieved (as long as only the Umbraco tables for you website are contained in the database) with the following SQL script:
exec sp_MSforeachtable 'ALTER SCHEMA dbo TRANSFER ?'
For more details, I have recently written an article on copying an Umbraco Website found at the following URL:
http://www.carbonsoft.co.uk/articles/2012/06/copying-an-umbraco-instance.aspx
Although this question was asked some time ago, I hope this helps others with similar problems,
You also get this error if you have no database in your connection string.
Umbraco's datalayer is (unfortunately) case-sensitive - which means that Umbraco can't find the table umbracoDomains. Check that the table is correctly named and/or cased - if your database is case-insensitive then make sure that all your tables are lowercased, as this should work.
carbonrb is right, when umbraco installation creates db it uses default credentials for db user. You can change schema to dbo like carbonrb advice or create user who has default schema the same as installed by umbraco. User cannot be in sysadmin role because it will override default schema back to dbo.