For a part of my network with 4 similar websites (same code, but different layouts) I would like to create one application with 'Zend Framework 2' to control these 4 websites in one app. This application should take a look which domain is requested and render the right main layout and view layout for the requested website.
My thoughts about this is to write a plugin who set a variable for layout/view at the time when bootstrap is executed.
Is this right or is it better to do this in another way?
I'd suggest that a plugin or a small module that listens to the dispatch or bootstrap events would serve you best. Rob Allen has a complete list of the ZF2 events in this post. Empirio Lab have a concise post with the relevant Module configuration on their site if you choose to go that way.
Related
I am creating a Kentico website and have been through the tutorial and reading up on the handling links for Kentico MVC. From what I understand, Kentico is encouraging developers to use the standard MVC routing to map pages to controllers.
This is fine for sections of the site, or if you only have a few pages, but the site I am developing has a large content structure and lots of top level pages.
It seems unreasonable to have to create a custom route in the App_Start/RouteConfig.cs for every top level page. Is there are better way to do this?
There's also another great post on the subject by Sean Wright. https://dev.to/seangwright/kentico-12-design-patterns-part-10-mvc-routing-with-nodealiaspath-22l3
I would recommend checking this out as well.
The Dynamic Routing module has been published on NuGet.
for the "Mother" admin
https://www.nuget.org/packages/DynamicRouting.Kentico/
For the MVC
https://www.nuget.org/packages/DynamicRouting.Kentico.MVC/
Documentation and source code on Github
https://github.com/KenticoDevTrev/DynamicRouting
I have 5 websites that run on the same business model and even share data in some form or the other but are all independent. I am now creating a central codebase for the backend which will be exposed to all 5 websites so that I do not have to maintain 5 different codebases. Is there a framework or design principle that allows me to use one front end framework to keep the 90% these websites have in common on one central code and extend or customize the UI for each of these websites?
If your layouts are same and you just want different skins for each website then you can achieve this by materializecss Sass. Check https://ghariaonline.wordpress.com/2016/03/14/materialize-css-changing-default-theme-with-sass/.
You can just change primary and secondary color in Sass code base and generate a separate css for each website. Whole look and feel will be changed for each website. Also you can achieve more customization by changing default tabs, navigation etc in Sass code base
VS2013 update 5, MVC5 using Areas
I have a stand-alone function programmed for a website. The functionality is a specific user interface to collect survey responses in a particular way. It has several controllers, a model and a group of views. The functionality is completely contained in an Area of the project, except for the Shared _Layout file that provides the main menu for consistency.
'Is it possible for me to' / 'how do I' compile this Area into a single or set of .dll file(s) that I could then add conveniently to other websites? I'm assuming creating something for transfer/download is very standard functionality. For example, I used Elmah.MVC for this site. What I want to do is pretty much create a package that can be downloaded in a similar way to how we integrate Elmah.MVC into a site. (Be certain I'm not talking about creating error logging software, I'm only using Elmah.MVC as an example of software that is easily integrated into other website applications.)
I've never compiled any website functionality into a .dll(s) for use elsewhere and would appreciate either some specific guidance, or perhaps what would be easier is to provide a link with a good step by step tutorial or explanation for how to do this. Most of what I've found on the web describes bits and pieces of doing this, but it's not enough for me to feel confident with it.
It seems to me there are a lot of 'moving parts' to taking a particular piece of an MVC application and turning it into something that is easily added to other projects.
A particular issue I don't quite grasp is the difference in downloaded packages between getting code and getting just the .dll(s). For instance, when I download an MVC5 site, I get controllers, models and views, but when I download Elmah I get a .dll and no code files. Also, I do understand the concept of transforms, but I'm just struggling right now with even getting from my programmed application into a 'package' regardless of the transforms that make it easy to integrate into another website.
These are just some of my questions I have about how to perform this particular process in developing deliverable and/or shareable software.
What you are looking to do is create a portable MVC Area project. A Portable Area is a set of reusable multi page functionality can be dropped into an application to provide rich functionality without having to custom build functionality that is literally the same in every application. An MVC Portable Area is really just a dll that contains the views, controllers, scripts, etc… needed to use in a website that is either a Web Forms website or an MVC website. A developer can use them for a reusable widget or a complete engine. I have actually used them for both. Here is a link with some basic info to get started. http://elegantcode.com/2012/04/06/mvc-portable-areas/
We are trying to extend IBM Connections 4.5 CR3 with own XPages apps not on the well described widget extension level for communities but on the application level.
Our goal is to extend the applications menu and load our apps inside the connections framework just like the original blogs or forums IBM apps.
Some others tried the same thing like this one:
http://blog.riand.com/2014/06/get-your-application-integrated-within.html?m=1
It seems that the trick for coming around the CORS trouble is not well documented in there.
Mikkel has put some code onto GitHub for the server side page generation:
https://github.com/lekkimworld/ic-wrapper
Can someone over here solve this or help us to come some steps further?
There are a number of approaches you can take, depending how daring you are.
The most pragmatic approach would be:Load a connections page, steal the HTML that makes up the Menu bar, copy that into a XPages custom control and you are done (of course you had added a link to your application beforehand in LotusConnectionsConfig.xml
Check the JSP that reads the LotusConnectionsConfig.xml how it is rendering the menu bar. Configure the Apache HTTP to expose the XML for read access, so you can dynamically create that menu - saves work when your menu changes often
Use the approaches described by Phil
Add a small JS that you call in your added menu. It would remove the content of the Connections page below the menu level and insert an iFrame which loads your XPage
Cheat by building a widget for a community homepage and have just that one widget (taking the whole page as real estate) in that Community
That's just off my head. Hope it helps
I'm reading [https://github.com/ServiceStack/ServiceStack/wiki/Run-servicestack-side-by-side-with-another-web-framework][1] but it doesn't explain enough or give a solution example (or I just don't know of an an example in the SS github site I can see something like this working with ASP.NET MVC and using that location element).
So I don't understand this custom service path from a Solution/Project perspective in the location element.
Here's how my current Solution looks:
Just a bit about the above pic. The MVC project that I created is that one I outlined in orange. I added then the ServiceStack projects I'll need to work with (we want to work with the actual code from SS, not binaries).
So now I'm looking back at the web.config that sits in my MVC proj as you can see in the pic which is open. So this "/api" for example, so what is that referring to? Like Our "Service" that we are gonna expose is in a different project ..you see that at the top, the project Called ServiceInterface.
I'm trying to understand how this works for the location. Location of what and how would I set that up in my solution here just for example?
#CoffeeAddict
sorry, but as a simple ServiceStack user like you, I feel the need to tell you
that it is good to have a lot of questions, but
Here is not private support, please make meaningful questions for all the others.
Don't waste time of mythz. We expect from him to deliver the new ServiceStack version.
If he is successful, all of us we will be too.
P.M
down in the page that you mentioned Run servicestack side by side with another web framework
there is an example of config Example config file for Asp.Net 3.5 in /api.
Maybe it is not appropriate for you, but it is not true, that there is not example.
Also, these questions
Running ServiceStack side by side with MVC
Service Stack on MVC4
the following is from you at Sept 25. It was answered from mythz.
Setting up Web.config to work Side-by-Side with ASP.NET MVC 4
Maybe you are not satisfied of course, but what to do about ? nothing.
check this also
ServiceStack.Host.Mvc / content / README.txt
Here
a user's blog post A mixed ASP.Net MVC 4 and ServiceStack reference project
and his sample project in githup DiffStack