Can modifying shopify theme markup break core functions? - dom

I'm about to take on my first shopify project where I will need to modify certain theme markup (for WCAG accessibility purposes).
Having never worked on Shopify before, I'm reading their documentation and theme editing using liquid seems fairly straightforward. However, someone warned me that modifying theme markup can sometimes break core functionality like the checkout process or something similar if/when shopify requires a certain specific markup to be present.
This would force me to opt for DOM manipulation with Javascript, instead of modifying template files - which is not a great way to go about it in my opinion.
Out-of-the box, do shopify functions depend on the markup in any way? I suppose anything's that written in Ruby should not be affected. Perhaps there would be JS that expects a specific DOM interaction. If anyone has run into similar issues, or can make any constructive suggestions, I would really appreciate it.

You can't break any Back-end functionality of Shopify if you modify the markup.
The purpose of the liquid is only to output some content, it can't modify the back-end in any way or form.
You can say that it's a glorified HTML markup with a few bells and whistles. ( but it loads before the DOM is ready )
In addition you don't have access to the checkout template if you are not on a Shopify Plus account, so it's really hard to even try to break something there.
That said you can break some base front-end functionality if you delete some items.
For example the product form needs to have an form element with an name="id" and value of the variant.id. If you remove that the product will not submit to the cart and you won't be able to use the checkout since you will never be able to add the product to the cart.
So yes you can break front-end functionality but you can't NEVER break the back-end logic with Liquid only.

Related

Any wordpress form building plugin for my requirements?

I'm looking for a WP plugin which can allow me to create different forms and embed them on pages and following are the requirements:
Only a single textbox required in each of those forms
The submit button will only be shown if a custom entry/answer is inputted into the textbox. (basically a client-side validation)
The submitted answer should be stored in the back-end with the usermeta (or just the username of the user logged in) so that I can export the entries in a format like csv, etc.
Any thoughts?
P.S. I have found one but not sure if the PRO version of this allows me to have a validation for a custom text. This is the plugin: http://wordpress.org/extend/plugins/visual-form-builder/
Gravity Forms is the most robust form builder plugin for WordPress. You can, with the right knowledge and skills, make it do pretty much anything you'd like. You can find it here: Gravity Forms.
Very well, I've found this. There are actually good plugins however, you will have to purchase it. I'm looking for a free one. http://www.webdesignboom.com/2013/formcraft-wordpress-form-builder/

Custom email templates per theme in magento

Is there a way to customise all the magento transactional emails (font-colours, link colours etc) per theme (storefront) without having to create each one though the admin area?
Thanks
I have been working on a module that would be able to handle this, though it is not complete (so many templates to edit!).
It involves including a template at the beginning of each email template that includes style information which then gets cascaded down to the rest of the template. If you had multiple themes, you could simply copy the template from /base/default to /your/theme and that should work.
Unfortunately, it has not been an easy module to build. The transactional system in Magento is fairly rigid in what you may do.
Alternatively (and this would be equally as much work) is to have a look at the sales.xml layout. You could rewrite the Email Layouts Section for each theme to point to different templates in your email, but this would be a lot of work and it would still be pretty cumbersome to maintain.

Which template system should I use in Typo3?

Up to now, I used to use template auto-parser. I like the fact I can modify any element of the template using typoscript, without altering the initial HTML file. I also like the fact that I can render the html template directly in a web browser, filling it with dummy elements to see examples of menus and content elements. Finally, with the new backend templates, i now can place content elements anywhere on a grid, in a way that mimics the real aspect of the website.
I know there is also TemplaVoila. I never took the time to learn it. My feeling is that it is less compatible with some extensions, but maybe I am wrong.
Now, there is fluid, that will be used in the next version of Typo3. While it is clear that it is better using it that using template markers, I don't really understand why I should be better using Fluid than using template auto-parser or TemplaVoila. What I dislike is the fact it requires to modify the html template with special tags, meaning that either the web designer has to know Fluid, or the Typo3 integrator has to modify templates from the designer each time a modification is performed.
My question is: should I migrate form template auto-parser to Fluid for my website template? What are the benefits of using Fluid? Why should it be better? What template system should I use with Typo3?
As long as TypoScript does not support objects, the benefits of FLUIDTEMPLATE over template auto-parser are only a few. So there is no need to migrate.
But IMHO there are some arguments to switch to fluid:
more and more extensions will use fluid, so it will help you to learn fluid
you can use an ide with code-completion for fluid (it is just XML!)
fluid is really powerfull, you can have f.e. if statements which checks for empty content
some day TypoScript will support objects as well
But for extension developement, it is totally different. In an Extension, i would allways prefere using FLUID. You do not have to deal with template things inside your extension anymore. Just pass the data to fluid and things which concern the view will be done in your template.
Whever you choose, it should be something based on Fluid - this will allow you to be extremely versatile and it makes the implementation less important than the template, which is quite good.
I myself am the creator of the "Fluid Powered TYPO3" framework (formerly known as FED) and would of course recommend that you take a look at what this framework can do for you - it's capable of great things, not the least of which is saving you a lot of time while at the same time allowing you to create even more consistent templating for pages and content - and even backend modules.
And we're always happy to help new users. We are currently in the process of improving our documentation, but you can already find many fully up-to-date guides on our Github page - https://github.com/FluidTYPO3 - the repository called "documentation" is the place we will store all the documentation.
You may want to have a look at http://fedext.net http://fluidtypo3.org - especially the "Tour of features" which tries to explain the point of Fluid Powered TYPO3 in as few words as possible. After that, the examples from the documentation will give you a much clearer picture of what Fluid Powered TYPO3 can do for you.
We focus on efficiency always - we've tried to do all the heavy lifting so that you really can just sit down and begin creating page templates. We took a lot of inspiration from TemplaVoila but there is no more re-mapping of content and things like this: when you change your templates, that change is immediately reflected, which makes it very nice to work with in iterations and do things like continuous delivery and -integration.
Hopefully this helps!
Cheers,
Claus aka. NamelessCoder
You could also argue, that adding special tags like
<f:section name="typo-content">
<div id="content">This is where the designer intended content to go</<div>
</f:section>
Could assist your designer while doing a redesign to know where you "mapped" your content elements to. This is neither the case with autoparser nor with TemplaVoila. So if the designer moves stuff around you probably get your templates back and they still work without any modifications.

What separates a content management system from just a bunch of web pages?

I have a website that has related pages. They have links that point back and forth to one another but I have no integrated system, nor do I know what that would mean.
What is the minimum code that a group of web pages must have to be considered a Content Management System (CMS). Is it that all the settings are in the database and the pages are generated somehow? Is there some small snippet that all my pages could share that makes them a CMS, database or not?
Thanks. I was also hoping not to have to study a giant CMS to see what makes it a CMS . After maybe a basic understanding I would know what I was looking for.
edit: here's why I ask about code. Whenever I have looked at a CMS, and maybe they aren't all the same, I saw that to develop a module you always had to inherit from certain classes and had some necessary code. I didn't know if there was some magic model that I just don't get that all cms makers understand.
edit: perhaps my question is more about being extendable or pluggable. What would a minimum look like? Is it possible to show that here?
edit: how about this? Is something a CMS if it is not extendable and/or pluggable?
I think this is really impossible to say. We all manage content. The "system" is just whatever mechanism you use to do so(dragging and dropping in Explorer or committing content changes via a SQL query). To say there is a minimum amount of code needed really isn't indicative. What is indicative is how often you find yourself making mistakes and how easy it is for a given user of a given skill level and knowledge to execute the functions in the designed system. That tells you the quality/degree of what you have in place being worthy of being called a "CMS."
Simply put a CMS is an application that allows the user to publish and edit existing web content.
In response to the edit:
A "good" CMS allows of extensibility. By using inheritence you can extend the functionality of a CMS outside of the core components provided. That's the magic.
About Extensibility:
Depending on the language/framework you want to build your CMS with, you can load pages or controls(ASP.NET) using command built into the framework. Typically what is being done is a parent class/interface is being defined that forces an module that is to be developed to follow some given standards:
Public MustInherit Class CMSModule
'Here you will define properties and functions that need to be global to all modules being developed to extend your CMS.
public property ModuleName as string
End Class
public class PlugInFooCMSPage
inherits CMSModule
end class
Then it's just a matter of simply loading a module dynamically in whatever construct a given language/framework provides.
Ultimately, a CMS is a system that lets you manage content, so it needs an user interface that is dedicated to letting you easily create, edit and delete pages on your website.
However, it's fairly usual to expect from a CMS to provide a browser-based WYSIWYG page editor, file uploading, image resizing, url rewriting, page categories and tags, user accounts (editor, moderator, administrator), and some kind of templae system.
Without dragging you into a theoretical explanation of what a CMS is and what it's not, perhaps some tutorials on the building methodology of a CMS will help you better understand.
http://css-tricks.com/php-for-beginners-building-your-first-simple-cms/
http://www.intranetjournal.com/php-cms/
A Content Management System is a System that Manages Content. :)
So if you got many pages that share the same layout, you can create a system that stores the content into a database and when a page is requested, it gets that content, merges it with a template that contains the page header, menu, etc.. and outputs the result.
The basis idea is that you don't want to copy HTML pages, and have to edit hundreds of them when you want to change your layout.
Such a system can be very complex, featuring wysiwyg editors, toolbars, version control, multiple user publishing and much more, but it could be as simple as a single page behind a standard loging, that contains only an input field for the title and a textarea in which you type the html content.

Best Practice creating Forms in Wordpress

I was wondering what is the best practice for creating forms in Wordpress? As a developer I hesitate to use a plugin like CForms, but I can understand why someone would like to use it. In the end I want to know the following:
What is the best practice for creating forms in Wordpress? (Custom HTML/CSS with Javascript and PHP validation or just using a specific aspect of the Wordpress API?)
I don't use any part of the WordPress API for forms. You could automatically grab the name and e-mail address out of the cookie WordPress creates when someone leaves a comment, if you want to try to auto-populate some fields.
An easy way to handle forms is to use Page Templates. That lets you create a new PHP file for a specific page, overriding the default page template of the theme. Then you can simply have the form post to itself and this one page template handles the processing as well.
http://codex.wordpress.org/Pages#Page_Templates
A lot of what's available for WordPress in the way of addins, and what gets a lot of attention, is stuff that I find makes little use if you have programming and general web skills. Almost always they seem to (necessarily) overgeneralize a requirement with a zillion options and configuration requirements because they are first of all designed for non- or barely-programmers.
Just learn the fundamental paradigms, scratch your head and wonder why nothing is consistently abstracted and/or encapsulated, get over it, and use what you already know about php and HTML-based forms. WordPress doesn't add much in the way of either tools or constraints.
I find the Widget feature applies usefully to most everything these days, and Forms is a candidate. But that's my own WordPress viewing prism - YMMV.
What do you mean by "in Wordpress"? Do you just mean placing the form HTML in a Wordpress template? Or storing data collected in the Wordpress DB? If you just want to create a form on your site, there's nothing Wordpress-specific to worry about. I believe there's some special Wordpress data facilities you can use if you're creating a widget or plugin or whatever they're called now. But if you're not, just create the HTML, and point it at a target URL that processes the values and puts them in a DB, Wordpress or otherwise. That target URL could be a separate PHP resource, or the same page. If it's the same page, you just need to include your PHP somewhere in the main Wordpress flow.