Theme Specific Wordpress Custom Fields - wysiwyg

I'm currently in the process of building a wordpress multi-site for a client. I've completed aspect #1, which was creating Theme-1. Theme-1 was built utilizing excessive amounts of the AdvancedCustomFields PLUGIN.
I'm working to build Theme-2, this one is the primary theme that will be utilized for all of the sub-sites created through the multi-site option. The issue I'm having is that the AdvancedCustomFields are no longer an option, I need to build all of the customization into the functions.php file directly.
Is it possible to create custom fields through the theme directly - without utilizing a plugin?
I need the theme pages to have "Left Side" "Right Side" "Footer" as WYSIWYG editors. So if someone goes to create a new page all of these field settings are there by default.
Is this possible?

It's possible, using the wp_editor function to get the WYSIWYG functionality. See this question on the WordPress stackexchange site. It's demonstrated as a plugin, but you could just as easily put the code in your theme.

Related

How to add custom layout to page fragment in Liferay 7.3

I have followed this tutorial https://help.liferay.com/hc/en-us/articles/360018167031-Creating-Layout-Templates to create custom layout for Liferay 7.3. After deploy the layout to the Liferay manually using app manager, I'm not able to find the custom layout in Fragment and Widget option.
When I check in Global Menu > Control Menu > Components > Layout Templates. I'm able to see my custom layout.
Did I missed anything or is there any other way to add custom layout to Fragment and Widget options?
Thanks
You missed one crucial info: "Layout Templates" are only applicable to pages of the type "Widget Page" (the default and pretty much only page layouting method in Liferay 6 and earlier). "Page Fragments", on the other hand, are only applicable to pages of type "Content Page" (which came up somewhere between 7.0 and 7.3). You set the type of a page at the moment you create them, by selecting one of the corresponding page templates.
So, if you want to create a certain row/column layout as a template for your "Content Page", you may want to look into the page fragment type "section". Basically, you'll be creating a Page Fragment that incorporates some <lfr-drop-zone id="invent-your-own-id"></lfr-drop-zone> tags in its HTML. Documentation on dropzones is very sparse at the moment (best source I found is Liferay's issue tracker plus experimenting yourself), but as this tag currently does not allow more attributes than id, you can simply experiment with it.
(Side notes: Due to some arcana in some standard documents, you cannot use the self-closing form of the <lfr-...> tags, so <lfr-drop-zone id="abc" /> will fail silently. Also, remember that the HTML part of a page fragment actually will be interpreted as an FTL template using Freemarkers alternative syntax before the <lfr-...> tags are interpreted., which gives you the option of placing a configurable amount of dropzones using a loop.)
But: take a moment to check whether you really need a custom "dropzone layout", as Liferay already provides you with a configurable "row section" in the content page editor; and anything more complex will give you headaches when making it responsive.
We are going through this exact same situation. Up until 7.1, we used Layout Templates on Widget Pages to enforce a consistent design over our Org's Intranet, while still having per-Department Authors (see Herding Cats).
New requirements, including the Users overall desire to have more control over page layout and simplified editing, as well as personalization (using Segments), are forcing us to implement the features of Widget Pages (and Layout Templates) in Content Pages. So far, Page Fragment Sections (as #orithena suggested) are giving us a path forward.
Now, we're developing for 7.2. 7.3 seems to be taking this concept even further, with the afformentioned drop zones, nested row layouts, and Master Pages.

Control Panel - Apply different theme for two different pages

I have created control panel theme following bootstrap standards. For some reason, we are using liferay 6.1 which doesn't provide responsiveness and hence has to be taken care of.
As we know control panel contains many pages e.g: MyAccount, User Administartion e.t.c.
As of now,these pages are looking fine with the old theme(non-bootstrap).
As and when I update these pages to bootstrap standards, I want to be able to apply bootstrap control panel theme for them.
Question here is - How do I apply old theme for MyAccount Page and bootstrap theme for User Administration page. Is there some property file that I need to update?
I did my research but couldn't find anything substantial.
Please let me know if I need to be more specific about the query.

Creating a responsive design using CQ5 templates

I'm investigating Adobe CQ5 and would like any advice on how to integrate its drag-and-drop UI to create a responsive website. It seems as if it works on a concept of fairly bland templates with components that can be dropped in pretty much anywhere, including things like "three-column control" - which would make designing a responsive grid structure very hard (as it would be hard to prevent users from dropping in a control that could ruin the layout).
Does anyone have any experience or advice on this? I'm really looking for deep technical details on the structure of templates vs components (paragraphs), and where/how to manage to the CSS.
CQ5 offers ways to control what can be done within a template, so thinking that components "can be dropped in pretty much anywhere" may be misleading. Page templates are designed and configured so that you control which components can be added to a certain area of a page. This allows you to only make those components available that will work with the template layout, excluding components that would wreck the layout. Then authors are only allowed to use things that will work. If they attempt to drag a component onto a paragraph (parsys) where that component has not been configured as available, the UI will not allow them to use it there. So CQ actually makes it easy to prevent users from dropping a control somewhere that would ruin the layout.
This is outlined a bit here:
http://dev.day.com/docs/en/cq/current/howto/components_develop.html#Adding%20a%20new%20component%20to%20the%20paragraph%20system%20%28design%20%20%20%20%20mode%29 which states that
"The components can be activated (or deactivated) to determine which
are offered to the author when editing a page."
When it comes to CSS and JavaScript, you can create a client library and then include the relevant client library on the page. Backend CQ functionality will take care of combining multiple CSS (or JavaScript) files into a single minified file to allow for a single HTTP request of an optimized file. This it outlined a bit here:
http://dev.day.com/docs/en/cq/current/developing/widgets.html#Including%20the%20Client-Sided%20Code%20in%20a%20Page as well as
http://dev.day.com/docs/en/cq/current/howto/taglib.html#%3Ccq:includeClientLib%3E
So you might develop several components that share a client library, then when any of the components is added to a paragraph the client library will be included on the page. You may also want a CSS library that applies to all the templates to give a common look and feel, yet allow components to add their own when they are used.
These guidelines for using templates and components outline how you provide control, yet flexibility:
http://dev.day.com/docs/en/cq/5-5/developing/developing_guidelines_bestpractices.html#Guidelines%20for%20Using%20Templates%20and%20Components
I'll document our successful WIP experience with RWD and CQ5
Assumptions:
A well documented style guide.
Our First Steps:
Modified existing column control component css to utilize twitter bootstrap grid css.
Create a base page property allowing two different classes on the grid container to be set and inherited by child pages. (container||container-fluid).
Leverage out-of-the-box components where ever possible.
All component widths inherit the width of their parent container allowing for components to be dropped into any location within a template.
Issues:
The out-of-the-box column control component can not be nested.
We are looking into building a custom column control component.
Takeaways: this is an evolutionary project and we are constantly iterating.
With the recent launch of AEM 6.0, they have an example website called as Geomatrixx Media. This website is responsive.
You can take this example as reference and start building on top of it.

Email Editor Similar to Campaign Monitor or Mailchimp's editor?

I looking for either an open source (or otherwise) php script/library/code that will provide me with a similar email composer that Mailchimp and Campaign Monitor have.
I've played around with lots of wysiwyg editors (eg: tinymce, ckeditor) but, they don't work very well for allowing users to compose emails.
Mosaico Editor is the first open source email template builder of this kind (AFAIK).
You can find a free to use deployment (working also as live demo) at http://mosaico.io and you can get sources at https://github.com/voidlabs/mosaico
I choose blocks from a set defined by the "master template", then you fill you contents and change their styles in a WYSIWYG style. If you're on a large window you can also have live preview for the mobile version.
The master template defines what are the blocks, what you can edit and what you can style and it contains any html trick to make it compatible with most clients: this means you can change the editor behaviour a lot by simply writing a new master template.
It is 99% javascript (IE10+, and any other modern browser) and depends on server-side functions only to do "final inlining" and "image upload/resizing"
Next generation tool for building templates without coding
Grapejs official site
GrapesJS is an open-source, multi-purpose, Web Builder Framework which combines different tools and features with the goal to help you (or users of your application) to build HTML templates without any knowledge of coding. It's a perfect solution to replace the common WYSIWYG editors, which are good for content editing but inappropriate for creating HTML structures. You can see it in action with the official demos, but using its API you're able to build your own editors.
I'm in the process of building one but as a designer it is a work in progress! I'd suggest looking at PHP template engines. They have a similar functionality. Most however will use php variables inside the html page instead of tags.
Another oprion is to check out Perch it is officially a CMS, but is really lightweight and might get the job done for you.
Hope that helps even though it is a year after you posted the question...
EDIT: Actually just stumbled across this thread which links to the new CKEditor - looks pretty cool.

Wordpress Cusutom Page, With PHP,js html and css

How can I implement a full html,php,js and css page into a wordpress page?
Example:
I have a app.php that has a text box, when You press enter it displays the text with a php echo. With the users profile picture from Facebook.
How Can I inset/implement that into a WordPress page?
HTML/PHP: The simplest way may just be to create an extra template in your theme. You can view WordPress template hierarchy here: Template Hierarchy
JS/CSS: If the JavaScript and CSS makes the most sense to be embedded (it usually does!), you can use hooks and actions in a simple plugin (or potentially your functions.php page) to include the JavaScript and CSS you need.
wp_enqueue_script
wp_enqueue_style
Note: I have not personally used functions.php (found in your theme files) to call these sorts of hooks, but I assume it would work just fine.
If you are using a theme that constantly receives updates, it is worth building a plugin to do the job. If not, it's easiest to just modify the theme.
There are two options as far as I know. First one is that you embed the code directly into your posts, and install the plugin called PHP execution. Second, try to create your own page template, and place your own code in the template. then you can create a page in the dashboard and select the template.