Detailed documentation about mapping a web templete inside Orchard CMS [closed] - html

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I found a web template on the net link and I want to allow end-users to edit the website using CMS. I found Orchad CMS, which is based on ASP.Net MVC. But the problem I'm facing is that I didn't find the full documentation on how I can map a web template similar to the one I provide to be managed inside a CMS such as Orchard so that end-users (non-technical users) can add new images, change the home page message, add new projects, etc.

This basically comes down to "writing a new theme" and implementing the functionality :).
The specific page you are referring to is fairly simple to implement in the Orchard which as a CMS, has extensive content definition and editing possibilities.
However you might want to try this first:
Forget about the template/theme for a second
Download and run Orchard in Visual Studio
Try to build your functionality with the default theme
Configure it so that other users (create a test user) can use it as you want (create new projects and change names/images).
To give you a head start for #3 (NO CODING REQUIRED):
Your functionality is a list of 'recent projects'
In Orchard, a 'recent project' can be implemented as a ContentType (of which users can 'create instances' also called ContentItem(s))
One way of defining contenttypes is by using the admin interface behind "Content Definition". Make sure the module "Content Types" is enabled.
Your 'recent project' contenttype basically has two properties namely "name/title" and an "image". These can be implemented in several ways which I won't all mention, but the easiest way is by adding Fields to the contenttype definition (A TextField for the name/title and an ImageField for the image).
tip: You can also implement the name/title by adding the TitlePart to the RecentProject contenttype instead of using a TextField. Parts are one of the concepts which make Orchard a very powerful CMS and this one is the easiest to understand. The result is more or less the same, you will get a way to add a title to the contentitem instances.
Up to this point you will basically be able to create "RecentProject" contentitems. You will now need to create a way to render your contentitems on the frontend. Again there are multiple ways of doing this. I'll continue on the path where you do not have to create any code.
Add a ContainablePart to your RecentProject contenttype.
Create a List named 'Recent projects' (optionally restrict the containable items to 'RecentProject' which should be listed after you add the containerpart to your contenttype
A list also has the AutoroutePart attached which is the mechanism for proving a frontend url to display contentitems. By default a url is created based on your title to this would result in a page /recent-projects
Make sure the Lists module is enabled
Read carefully: Do not create your RecentProject contentitems using the link in the upperleft of the admin ("New > RecentProject"), but go to your 'Recent projects' list which you just created. There is an option to create new items in that specific list which automatically hooks up the items to the list (this is all done using the ContainerPart).
At this point you can go to /recent-projects and see your Recent Projects list being displayed in Detail mode. The Detail display of a List basically renders each of its Contained items in Summary mode (and also a optional pager). Don't mind the way it looks right now. If you got everything up to here then you can start with the first link I mentioned about writing a new theme, but more importantly you should try to understand "Accessing and rendering shapes" and "Understanding placement info" both of which are used to manage those display modes like "Detail" and "Summary".
Enable the Shape Tracing module to help you with this. It is gold!

Related

Is there a way to make a spreadsheet-like database on Mediawiki?

I'd like my wiki to have an editable database of links to videos from Youtube and other sites, along with properties about the videos, such as the language. Then on a page, say, "Chinese Videos", it would pull all the links that have the property "Chinese" and nicely display them.
The best solution I can think of so far is creating a CSV page that contains all the data, then using the ExternalData extension to grab items from it to display. But editing a CSV is not very user friendly and it'd be hard to search/sort through it to see if a link has already been included, or to add/remove properties.
Is there a better option for an onwiki database suitable for this use case? Maybe wikibase, although the documentation talks about its purpose being one wikibase item per page.
I've searched for a suitable Mediawiki database extension, but I haven't found one yet.

How to get custom functionality in Django admin. Are there cases where it's recommended to do your own admin page from scratch?

This is a quick question for any experienced Django developers.
I have been trying to implement an admin page for 'Products' for an e-commerce store.
My vision for it was to have the top half of that form being used to enter information about a product which is a model I have defined. In the bottom part, I wanted to create some kind of inline to create ProductVariant (which is also a model I have) objects. Within the ProductVariant, I need some type of JavaScript behavior which displays or hides fields based on information entered at the Product section.
My question is would you recommend just completely throwing away the admin framework provided for that specific page and doing my own thing from scratch because I have just been struggling to get the custom functionality I want.
Yes to get the custom functionality you are describing, you’d probably need to implement, on your own, certain parts of the admin site (most likely overriding the templates). Some people even go as far as creating an entirely new admin site if they intend to work with frameworks like React.
That said, I’d look into the templates of the admin site in the Django libraries and, perhaps, copy most parts of the template then style and and add JavaScript as desired because you might miss certain key elements of the original if you do your own from scratch.

How do large websites manage so many webpages? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
How do large websites create so many webpages? Do they make a new .html file everytime they want a new page on their website? I read something about how links on these large websites arn't really pages but created in a database. If so how can I make a website with a database for webpages. Im trying to make a website that lets users download stuff but that would be a lot of .html files so whats the best way?
Templating.
Depending on the type of page you want to serve: home, section, article, etc... the server knows how to respond to different page requests.
If the header code and footer code repeats over multiple pages you include this partials in those different templates
Since your question is focused on websites havig N pages say for example a website with many products, the design for a product looks the same, so all you need is to instruct the server how to handle a specific route:
example.com
head
welcome
footer
example.com/products
head
allProducts (pagination etc)
footer
example.com/products/101
head
product<id>
footer
here the server detects that a request for a route has some ID after /products/, your backend logic should use the article (product template), go grab that product ID from the database (image, images, title, description, content, price etc) and populate such single template with that data - and send it to the client.
That way no matter how many products (pages) you have, you need only one HTML template.
SPA (Single Page App) follows the same principle, just updating the content with AJAX (no page refresh)
That depends on so much stuff ...
Sure you could have a separate html file for every page. Especially if you want to not be javascript dependent. Routing then happens trough the folder structure and you access every page separately by making a GET request on the specified address.
That's old-school. I think that kinda changed with PHP & Wordpress where a page skeleton is fed with data coming from the db and then that is displayed to the user.
Nowadays your backend feeds data to your frontend, usually through json format.
So the page you are visiting is the front end of a web app. The backend waits for a request which it then handles by serving the right data, if authentification is OK. All that is done usually with PHP or any other backend language and using a DB, SQL or NoSQL.
The front end is only one tiny html page with nice javascript which just replaces any element in the page like you want depending on what the dev' decided to.
That's Angular or Vue.js
Edit:
See Roko C. Buljan's answer
above. It answers it
more eloquently.
In the future, I will focus on answering the actual question being
asked.
I'm new here.
Great question. The requirements for the website you're trying to make moves past what static .html pages can provide.
Although from what I understand you are trying to build might be complicated to build from the ground up, as David mentioned frameworks would be the way to go. for example a nodejs/vuejs app (website) built with a 'stack' of programming tools present one 'view' (page) and change the contents of the page based on what actions the user takes.
Here are tutorials on:
nodejs - the server.
vuejs - the view and brains of your app.
MongoDB - your database you referred to for stack style apps.
These 'stack' types of apps (websites) cut down on all the document transfers of .html pages for the user to wait for and really increases speed and usability.

Sitecore, why is so difficult? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am new to sitecore and my company has been using external company to manage their sitecore, which I totally understand, since it involved so much work on the development.
As a designer myself, I found extermely difficult to create a custom page unless I use what's already available. I could use simple page to insert my html codes but again, it's just way too long. In regular case, when you build a html site, you could simply create pages in dreamweaver and view it on your local computer.
I have tried to make a custom page with the presentation control, but each time I called a sub-rendering. the page is just a BLANK.
*so my 1st question will be, What's the procedure to create a custom page? *
I know sitecore suppose to be powerful and there is many api, I really would like to find out why I found it's so difficult......
my background is, designer base with knowledge of html, css, and php. I am not a developer that's for sure. :)
Thanks for taking time read my blah blah..:)
1st question will be, What's the procedure to create a custom page?
To answer your first question, there are some high levels steps you would generally take.
Create a page template that includes any fields or metadata you need to render the page
Create any layouts, sublayouts, or renderings necessary to render the custom page - this is where having access to a developer normally becomes necessary
Assign the renderings and datasources to the instance of your new template (or better yet, assign the renderings to __Standard Values item)
Publish everything out
You should reference the Self-Study to Building a Very Simple Site from Sitecore
2nd question will be, why do we need to call the developer each time when we want to have some feature inputs?
To answer your second question: To get very far with customizing Sitecore you will need to be a developer or have access to one. This can be mitigated to some extent depending on how flexible the solution is they developed. But let's be real - Sitecore is an Enterprise CMS, it's not Wordpress where you can install a theme and a few plugins.
As someone just learning, there are a number of options
Training from Sitecore - this is probably your best bet
Download and play with Launch Sitecore for sample code and examples to build a real website
Check out the Sitecore Marketplace for modules that can get things done for you
Subscribe to and read John West's blog for inside information of basically every aspect of Sitecore
3rd question is, why I can access the CSS?
This question doesn't make sense frankly, so I will assume it was meant to ask "How?" or "Where?" Without any more information about the site in question, you can normally map the URL to the location on disk. For example:
http://www.mysite.com/css/styles.css
This URL might map to c:\inetpub\wwwroot\mysite\website\css\styles.css
I do highly recommend that any code changes, including CSS, be done through your source control system and only be deployed following your standard release management.
Honestly, I don't believe you are qualified to modify and maintain the Sitecore site given your current training and experience level. The first step I recommend is getting that Sitecore developer training and any training available from your vendor on the specific implementation. Good luck!

Client-side templating frameworks to streamline using jQuery with REST/JSON [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I'm starting to migrate some html generation tasks from a server-side framework to the client. I'm using jQuery on the client. My goal is to get JSON data via a REST api and use this data to populate HTML into the page.
Right now, when a user on my site clicks a link to My Projects, the server generates HTML like this:
<dl>
<dt>Clean Toilet</dt>
<dd>Get off your butt and clean this filth!</dd>
<dt>Clean Car</dt>
<dd>I think there's something growing in there...</dd>
<dt>Replace Puked on Baby Sheets</dt>
</dl>
I'm changing this so that clicking My Projects will now do a GET request that returns something like this:
[
{
"name":"Clean Car",
"description":"I think there's something growing in there..."
},
{
"name":"Clean Toilets",
"description":"Get off your butt and clean this filth!"
},
{
"name":"Replace Puked on Baby Sheets"
}
]
I can certainly write custom jQuery code to take that JSON and generate the HTML from it. This is not my question, and I don't need advice on how to do that.
What I'd like to do is completely separate the presentation and layout from the logic (jquery code). I don't want to be creating DL, DT, and DD elements via jQuery code. I'd rather use some sort of HTML templates that I can fill the data in to. These templates could simply be HTML snippets that are hidden in the page that the application was loaded from. Or they could be dynamically loaded from the server (to support user specific layouts, i18n, etc.). They could be displayed a single time, as well as allow looping and repeating. Perhaps it should support sub-templates, if/then/else, and so forth.
I have LOTS of lists and content on my site that are presented in many different ways. I'm looking to create a simple and consistent way to generate and display content without creating custom jQuery code for every different feature on my site. To me, this means I need to find or build a small framework on top of jQuery (probably as a plugin) that meets these requirements.
The only sort of framework that I've found that is anything like this is jTemplates. I don't know how good it is, as I haven't used it yet. At first glance, I'm not thrilled by it's template syntax.
Anyone know of other frameworks or plugins that I should look into? Any blog posts or other resources out there that discuss doing this sort of thing? I just want to make sure that I've surveyed everything out there before building it myself.
Thanks!
Since posting this question, I have found many other templating options. I've listed many of them below. However, there was recently a jQuery templates proposal that may be the most promising solution yet. There is also a discussion about it on the jquery site. Here is the project location:
https://github.com/nje/jquery/wiki/jquery-templates-proposal
Other solutions I've come across include (in no particular order):
http://www.west-wind.com/weblog/posts/509108.aspx
http://ejohn.org/blog/javascript-micro-templating/
http://beebole.com/pure/
http://archive.plugins.jquery.com/project/jTemplates
http://archive.plugins.jquery.com/project/advancedmerge
http://archive.plugins.jquery.com/project/tempest
http://archive.plugins.jquery.com/project/jBind
http://archive.plugins.jquery.com/project/cliche
http://archive.plugins.jquery.com/project/appendDom
http://archive.plugins.jquery.com/project/openSocial-jquery-templates
http://archive.plugins.jquery.com/project/Orange-J
http://archive.plugins.jquery.com/project/fromTemplate-microtemplate
http://archive.plugins.jquery.com/project/resiglet
http://archive.plugins.jquery.com/project/databind
http://archive.plugins.jquery.com/project/jsont
http://archive.plugins.jquery.com/project/domplate
http://archive.plugins.jquery.com/project/noTemplate
http://archive.plugins.jquery.com/project/jQueryHtmlTemplates
http://github.com/trix/nano
http://aefxx.com/jquery-plugins/jqote/
http://ajaxian.com/archives/chainjs-jquery-data-binding-service
http://ajaxpatterns.org/Browser-Side_Templating
http://beebole.com/pure/
http://code.google.com/p/google-jstemplate/
http://code.google.com/p/trimpath/wiki/JavaScriptTemplates
http://embeddedjs.com/
Javascript template system - PURE, EJS, jquery plugin?
jQuery templating engines
http://goessner.net/articles/jsont/
Sounds like you want sammy.js
http://code.quirkey.com/sammy/
The tutorials there demo use of the template engine
I've used jTemplates quite a few times and from my experience it serves its intended purpose.
If we're limiting the discussion to client side then this is my final comment on the matter as it does the job and despite some funky syntax does it well, however on the server side of things I would definitely prefer the scenario where you POST some JSON which is deserialized to an in-memory object and then validated and passed to a server-side template (such as an ASCX in ASP.NET) where you have the full power of that language.
In my opinion, if the client supports JavaScript well enough for you to be considering jTemplates then I would recommend setting yourself up a JavaScript utility method which allows you to send JSON and receive HTML, thereby cutting out the potentially troublesome middle man. Most languages have JSON-parsing ability and jQuery can auto-parse a server response into JSON by specifying the return type as "json".
Even if you don't receive the JSON from the JavaScript, you can still take the JSON that you would have sent back to the browser and just send it through your server-side template instead. In ASP.NET (with MVC for example) you can have strongly-typed template files that do not need to be compiled, making changes a lot easier to implement. Therefore you would still be sending back markup, but it would have been run through a proper template with the full strength of a programming language behind it.