Joomla: allow PHP on some articles without disabling TinyMCE entirely - php

I'm relatively new to Joomla and this is driving me crazy.
I need to use PHP code in some articles (3 of them exactly) in Joomla 2.5. I use the DirectPHP plug-in which seems to be working fine, BUT the TinyMCE editor gets in the way and automatically comments the PHP code out when I save the page.
I can of course disable TinyMCE entirely, and then everything works as intended, but I need to keep it enabled because other users need it (for editing other articles).
I checked in the TinyMCE plug-in options, but there's no option to disable code cleanup or anything like that.
I checked in the "Text Filters" page of Joomla (in Global Configuration) but this doesn't seem to help: "Administrator" (which is the type of my account) already says "No filtering", so that's not it.
I also tried to change the permissions for one of the articles I need PHP on, basically denying editing rights to every groups except "Administrator" and "Super User" (who both have the "No filtering" setting enabled in Text Filters). No luck either.
So I'm stuck.
Basically what I need would be to have TinyMCE disabled for those 3 articles only. Is that possible?
If not, what would be the best way of solving this problem?

Rather than using DirectPHP, I would highly recommend using Sourcerer. It has a very high rating, great support and is regularly maintained. It's the same sort of concept as DirectPHP but allows you to add other languages to your articles such as Javascript and CSS.
Here is a small example of how it works. Simple add the code to your article once you have enabled the plugin:
{source}
<?php
echo 'Hellow World';
?>
{/source}

Related

How can I successfully use a WordPress plugin to add styling to a website?

Some people are already styling their own websites, so is it possible
How do I get an html/css form to post to Gravity Forms?
Here is the link that also recognizes the problems that wordpress has, with users adding code, but it says if you download this plugin, your problems will be solved: Raw HTML plugin.
Here are the instructions from the website above:
To install the plugin follow these steps :
Download the raw-html.zip file to your local machine.
Go to ‘Plugins -> Add New -> Upload’.
Upload the zip file using the provided form.
Activate the plugin through the ‘Plugins’ menu in WordPress
Alternatively, you can search for “Raw HTML” in ‘Plugins -> Add New -> Search’ and install it from there, or unzip raw-html.zip and
upload the raw-html directory to your /wp-content/plugins directory.
I generally get to the point where I download the plugin (step 1, raw form) and then I am unable to proceed further. What should software I open the plugin with or do I need to go online (and where) to download the correct software?
Basically, I found out that certain software is required, not the plugin, to allow styling to the website. The link to access this feature is: how-to-use-plugin-not and she explains step by step. This thing type is for people using CSS, Bootstrap, HTML5, and JQuery. As far as I can see, no amount of research shows that a plugin is necessary but I was correct that certain preparatory steps were necessary. This is different than and unique from other methods of deeper coding.
Going to GitHub for an online portfolio would be more appropriate (shows your mastery more). This is according to Joshua Scott from free code camp but WordPress is great to develop CMS skills according to Jamie Schmidt, a developer for eight years.
The quick and dirty way that doesn't need any plugins or fiddling with the theme: throw your code into the content of the page you want it to appear on. Adding in the body is perfectly fine, and linking stylesheets outside of head works, even though it's not allowed in the specifications.
To do it the right way, you'll have to get your hands dirty and use a custom template file for the HTML and add your scripts and styles via wp_enqueue_script/wp_enqueue_style.

Joomla 3.8 Adding a Custom Registration Check

I'm building a website using Joomla 3.8.0.
I'd like to add a custom question to the registration process. For example, I'd like to ask them the capital city of Canada and then check upon submit if the answer was Ottawa. I'd like to do this, if possible,using an extension and not modifying php code within Joomla.
Does anyone know of such an extension? I've looked through the Joomla extensions directory already, but haven't seen one that seems to do what I want. Seems they all simply allow custom fields, but not fields that can be reviewed for a specific answer as described above. Preferably it would be free as well.
Thanks!
EasyCalcCheck Plus will do this for you. It's free. There are probably others too.

schemaorg Module Drupal 7 is not working

I have installed schemaorg Module in Drupal 7 Project, and have followed instructions in this video.
But it is not working for me.
I have tested it on this link.
But it is showing me the following result:
0 ERRORS 0 WARNINGS 0 ITEMS
And in source code as well I am not able to find any code for micro data...
Enable core RDF module along with Schemaorg module. You won't see any changes. If you go to admin area for content type there will be some new options. The link for all available types you can use: http://schema.org/docs/full.html
Please read this great article: https://www.lullabot.com/articles/how-does-rdf-work-in-drupal-7
UPDATE
I did some research, apparently according to google, JSON-LD is the recommended format, not RDFa as I thought. I fired up a new project on https://simplytest.me and I installed schemaorg module first. I had errors when I paste code snippet from Person content type, check here, but when I removed sioc:Item foaf: from typeof="" the errors were gone. Check here. Apparently you need to find the way through your template file to remove those extra lines in order to work from google search engine.
I tried new solution, and installed module which worked rightway from installation, which supports google JSON-LD, and the results were perfect!! The name of the module is structured data but you also need to install all dependencies, I think meta tags module, token.
When you visit the page in admin/config after installing you will see at the bottom of the page STRUCTURED DATA (RICH SNIPPETS) - MAIN CONFIG where you can add site name and logo. When you create new content let's say article, on the left sidebar you will see Meta Tags, if you want to add some futures, or disable.
Just to add that it is very important the theme you are using. If you are using custom theme (like from your example) bear in mind that HTML code should be well structured.
There is also nice article adding structured data to Drupal 7 nodes, with some examples which can help you to dive into tpl files.
I hope it helps

Jooma 3.1 Templating - Tutorials/Documentation?

I am to develop a Joomla 3.1 Template. The template should consist of a static header and footer, as well as multiple pages, all of which need their own styling. Further, the client would like to be able to add 'events' to a specific listings page. Customers should be able to book said events via a simple form.
Thanks to some really basic guides, I have the header and footer down, as well as some simple template options. However, I am now running into some problems;
How would I approach the content section? Ideally, a page would consist of multiple, editable sections. The client would be able to edit said sections in the backend without having to deal with or accidentally changing the layout or styling of the page itself. Since there are multiple pages, I obviously need different views/containers for each of them. Is this possible and if so, how?
Another problem is the documentation, which I found to be very lacking. Even google only got me so far (basic structure, index.php, templateDetails.xml and so forth). Are there any other resources I may have missed or do I really need to refer to other templates (most of which, obviously, aren't free) and use var_dump all the time?
Writing this, I just realized that I could theoretically build a template for every single page but ... that surely can't be right, right?
If someone could provide a basic outline or at least tell me how you personally would tackle a project like this, it'd be very much appreciated.
All the best
Edit;
I just found some video tutorials but since my bandwidth is limited, I cannot watch them. Please take this into account when writing an answer. Thanks.
I have only one word for you :
GANTRY :D
gantry-framework.org
Joomla revolves around menu items that point to components. For each menu item, you can assign modules to different positions within the template to create a unique page. You only need one template if you really understand how Joomla templating works.
Joomla has very good documentation here - http://docs.joomla.org/
Few things to remember -
Component - this is a type of content or app of sorts. A component will define what content is and how it is displayed. This can be anything from blog articles and categories to an event registration system to a message board or social network. Menu items generally will point to a view in a component.
Modules - these are used to display additional content around the component output. This can be a menu, or a login box, or a weather widget or anything else you can come up with. Modules can be assigned to or excluded from the various menu items on your site.
Plugin - plugins are used to change the final output on a site. They can be used to insert Youtube videos, or forms within content, or even to alter the meta tags on a page.
Understanding how extensions work is an important first step. Once you get how those work, learning how templates and template overrides work will give you most of what you need to know to build a basic Joomla site.

Joomla FrontEnd Editing breaks shortcodes

I have a joomla website in localhost.
I installed a template called Helix 2 which also has a set of Shortcodes. (i just put in something like [block]blah blah [/block] and my blah blah is highlighted in a nice looking box.)
I posted beautiful looking articles that way from BackEnd. Unfortunately, I have setup some users to be able to edit those articles from frontend. I have manually checked the Database and the shortcode is saved in the database. But when clicking edit in frontend, THAT DATABASE VERSION is not loaded in the edit field! When editing from frontend, the joomla engine DOESNOT load the database version of the article, but the version rendered from the browser or something else. The latter version doesn't have the shortcodes. So, after clicking save from Frontend the original article formatting is lost! I then have to manually reenter shortcodes in the frontend.
So the solution is, while clicking on edit button, if the article for editing is loaded from the database I can see my shortcodes in their proper places. So, is there a setting anywhere in joomla that can help me out with this?
PS: I HAVE TRIED ALL EDITORS TINYMCE, JCE, EDITOR-NONE WITH SAME RESULTS. ITS NOT THE EDITOR PROBLEM.
Which Joomla version are you using?
In Joomla 2.5 if you use a user from a different group, checkout the text filter options tab in the general settings. If you login as a super-admin and the setting for that group is "No filter", please try to change to "default blacklist" than save. Clear all joomla cache (just to be on the save site). Than change back to "No filter" option.
I have seen complaints on the joomla forum that the No Filter option while default set in some cases is not properely set. Resetting it to default blacklist and back to "No filter" might solve that problem.
What a simple solution and I had to spend so many sleepless nights surfing for a solution. In my site http://lokkatha.comthe problem was persisting for quite some time. However, with the help of the solution suggested by Wouter here, I could sort it out. the process is
Go to BACKEND ADMIN >> General configuration >> Text filters
Covert all filters to NO FILTERING The problem is solved.

Categories