Put ads on Orchard web site - asp.net

I am very new to orchard and to web development itself. I would like to know is it possible to integrate/add ads on Orchard web site and is there any resource about that.

Yes it is possible, but you would have to build a module to do this yourself, as there aren't yet any modules in the Orchard Gallery that handle ads. There are some easy ways to do it without adding any code; it really depends on what you need to do to place your ads.
If you simply need to drop some html tags into certain pages you can accomplish this through the Orchard dashboard UI in at least a couple of different ways. The easiest would be through Widgets. Dashboard->widgets->Sidebar->Add->HtmlWidget. Drop in the HTML tags into the wysiwyg editor there and set up the rules so that this widget publishes to the desired Zone, and on the desired pages. Note, the instructions above said to publish to the "Sidebar" zone, but you could substitute that for any zone you want. You can use rules/layers to adjust which URL's your ads appear on.
If you need more complex behavior you might accomplish it by creating a custom content type that has a BodyPart, or you could code a custom widget. For example some systems like Doubleclick for Publishers want you to add a random string to the HTML of the ads for cache busting. I don't know that Orchard has any token replacements that could be used for that, but you could do it yourself by coding your own part that does a token replacement on the body part.

Add scripts directly to the view you want to show your ads on.

Related

Can Sitecore templates be used to store SQL Queries or JavaScript

We are building a Page with dynamic functionality using ASP.NET + Sitecore 7.0.
Is it practical and appropriate use Sitecore templates for:
SQL Stored Procedure Name to be invoked
JavaScript to be invoked
ColumnNames to be used etc (related to coding customization)
Or should these configuration properties remain inside the ASP.NET Project itself?
What is the primary purpose of Data Templates in Sitecore?
Are they for developer customization or customer-level customization?
The purpose of a data template in Sitecore is to define the set of fields for content items which inherit from that template. - Think of a data template as a class and the content items (pages) as instances of that class.
Templates are usually used to define the user-editable content of pages within a site, that being said you can have items to store information which is not managed by regular content editors. The question is where do you draw the line between things which should be put into Sitecore and things which should be a part of the solution. My advice is only put things in Sitecore if they need to be there. If you have to have the ability for editors or admins to configure those settings/properties.
I would say that putting SQL/ColumnNames is probably a bad idea unless you are building some sort of report builder interface in which case it may be essential?
Likewise with placing JavaScript into Sitecore; this can be OK in moderation (e.g. snippets of analytics code which content editors may want control over?). If you're placing whole libraries of JavaScript into Sitecore, you're probably doing it wrong.
One final point to note is findability/re-factorability of code: if you have code spread between Sitecore and your solution, it can make it very difficult to maintain as it is difficult to get a complete overview of code involved.

WordPress technical theme design

In a typical WordPress project I guess there are 3 parties. Party 1 is the graphic designer providing psd/pdf or html that party 2 (the developer) will create a theme from with probably some custom posts so party 3 (the client and content editor) can update the site without messing up the design and with no knowledge about HTML, JavaScript, Gimp or PHP.
This would tie the main theme of the site or it's specific pages in the php page(s) and if some minor design changes need to be made it needs to be done through editing php files.
I was thinking the following for a theme design:
(assuming a content only site without having complicated sales statistics and such)
Instead of "programming" the page.php to fit the graphic design and bring in specific (custom) posts and other data I would have the page.php bring in sub content. This so the graphic designer can create the page without having to program.
When images need to be provided then wordpress can pre scale/crop for different screen sizes.
The entire page should be created from the editor by the designer NOT the editor/client and not in page.php:
<html {{lang}}>
<title>{{title}}</title>
...
{{main-slider}}
JS and css are added through custom fields so they can be merged to one file.
Main slider post looks like this:
<div id="main-slider">{{main-slider-content}}</div>
JS and css can be provided to overrule page css or js and will be merged to one file.
And the main-slider-content is content that the editor can provide through a custom post provided by the programmer that will hold the editor's hand all the way and makes sure everything goes right.
Some of these fields can be set with custom fields values of the page (reverting to defaults if missing) some will be overwritten by the post (like language or title).
The type of sites that will be produced by this theme are used by small business owners who would like some web presence.
I have a couple of doubts about the design and hope someone with more experience with wordpress can shed some light on this.
When the editor/client edits a custom post like some slider content they cannot preview the item because that content is basically used on every page. Even if I find a way to list pages where the slider is used and show that one it won't show the new content until it's published. Previewing pages seems a bit complicated to implement.
It takes longer to generate the pages because content and sub content needs to be fetched from the database after parsing the content. I've tried to do this with DOMDocument before and used <div data-custom-content="main-slider"></div> but that is too slow so I'll try with regexp.
Because content isn't going to change that much I thought maybe APC cache the page after a first request and serve it from there. Delete the cache only when something is updated. On VPS the cache could be (probably would be) trashed when the site is inactive for a long time (which would be quite often). This means that requests take a long time to process when people try to view the pages.
Anyone with experience or helpful tips in this
[UPDATE]
I see that particular design and the html template will still have strong dependencies on each other. I am thinking now of trying out Twig. The benefit will be that re usable components are classes that can be added to the project and full content is controlled in the wordpress editor in a way that someone with no programming experience can still manage the content.
When data needed in the page is going to change a programmer is going to be needed though.
This is kind of what the Advanced Custom Fields Flexible Content system does, and the way you've styled your examples looks very like Smarty, a templating system that used to be very popular, and which is still used by a few systems like Prestashop.
In my experience, this removing the middleman kind of idea doesn't work. You either need a very extensive - and therefore bloated - initial theming system to flex to different projects, or you need a basic one which a developer will customise later - in which case the best you can achieve is moving the developer's role to a different phase of the project.
Overall, I think the best scope for this type of idea is for designers to learn a bit more code.

Optimise ASP.NET CMS KooBoo for good SEO

I am considering using KooBoo CMS ASP / MVC CMS for a client.
One of their requirements is good SEO optimisation. What is the best way to do this in KooBoo. How does it compare to, say, Orchard CMS in this area? (and Wordpress, say).
I am talking about things like keywording, friendly URL's & generally behaving in a way Google likes and rewards in search results.
Thanks.
You can create the meta tags and description for each pages in KooBoo. Please following the step which is mentioned in kooboo help.
http://www.kooboo.com/docs/Kooboo-CMS/Page-settings
Please also see below link for URL rewriting of different site.
http://www.kooboo.com/docs/Kooboo-CMS/Kooboo-multi-sites-solution
I believe that extra support options were added for V4 of Kooboo. You now have a number of options.
Each Kooboo 'Site' has a 'System / Settings' page with a 'HTML Meta' section on it. This allows you to define site-wide meta tag values for all the common meta tags, as well as defining some of your own custom tags.
The same level of detail can be achieved on a page-level basis, where these values will be prefixed to the site-level values, allowing you to have titles like: -
You can also use tokens in the settings, that will get replaced with context-relevant values:
You also have a very high level of control over the URL's that Kooboo allows access to. Its default approach is for each piece of content to generate a SEO friendly "user key" that can be used to refer to the content. This User Key can then be used as part of the URL to access the page.
There is also native support for 'Robots.txt' and whilst generating a 'SiteMap.xml' is a little more hands-on, it offers perfect granular control for the developer: http://kooboo-cms.ru/articles/detail/sitemap-for-kooboo-cms/
I'm not yet familiar enough with Orchard to say if it offers the same level of SEO targetting, but I think Kooboo has all the major options nicely covered.

Basic styling in Orchard CMS

I want to allow admin users of my CMS-driven sites change basic css properties, add a logo and change pre-determined text items without having any knowledge of HTML or CSS.
I may have missed something but I can't see an easy way of doing this in Orchard without creating custom themes.
The Orchard system will be multi-tenant, by sub-domain.
My architecture consists of a brochure-style website which i'm happy to allow full control to the user through Orchard and a transactional mvc 3 website which i'm implementing as an Orchard Module. The user has much less control over the transactional website, but i would like them to be able to choose the background-colour, font attributes a logo and some text.
Does anyone know if this approach is supported by Orchard and if so, some examples would be nice!
I guess ideally i'd like for the admin user to set up the css values of the transactional site in the Orchard admin using colour-pickers for example. If i could then pull these values out of the Orchard DB with Razor like:
background-color: #Html.GetCMSValue("backgroundCssColour")
Thanks
This is exactly what you are asking for: http://orchardproject.net/gallery/List/Themes/Orchard.Theme.SuperClassic

Best practices to implement custom functionality on website

I was wondering if someone with Drupal experience could advice what are the best practices in the following situations. I think they are all common tasks for any website that you build.
Display a custom HTML of a certain content type at front-page (e.g., only the link and title).
Should I build a module only for this?
Customize the login form HMTL, including inputs, labels etc, to something very different from the default login block.
Again, another module?
Format the node view of some content types; for example: showing additional fields values. I have some Joomla experience and with it, it's very easy to override the template on your theme.
But with Drupal, it seems HTML is hard-coded on PHP files and there are very few thing that uses templates. Or am I missing something?
You should create a view (from Views module), and for this create display 'block'. This block you can use later on your site. Within your view settings you can choose what and how you will display.
It depends what you would like to put there. If you put just some static text, change theme could be a solution. But still, a bit smelly. What you should do, is to create a module use hook_form_FORM_ID_alter and add both - field to your form, and code to use values which user added.
Change templates for this content type in your custom theme; or use Panels module - here you have nice introduction; or use Display Suite module - which do pretty much the some work as creating a template
html is in php files, but where else can it go? Drupal also has it template overwrite system. The customization of the theme can be usually done using that alone.
As for your questions (there are also other alternative)
load the content type in view/block, display in list format on home page.
create your own theme for css changes. create custom tpl.php for
layout, and div naming etc.
same as above.
It doesn't hurt to create a new module, but generally it's not necessary unless you are going for something like a muti-step form.
You can use both Views & Panels in order to achieve what you've mentioned above.
For instance, Panels gives you the option to override the home page with your own content. This content can be organized with Views.
From drupal.org:
"The Views module provides a flexible method for Drupal site designers to control how lists and tables of content (nodes in Views 1, almost anything in Views 2) are presented."
"The Panels module allows a site administrator to create customized layouts for multiple uses. At its core it is a drag and drop content manager that lets you visually design a layout and place content within that layout."

Resources