JCK Editor Cleans the Code upon save - joomla3.0

I am using JCK Editor in Joomla 3 but when i try to put this code in article and
press save, it cleans up the code and i only get nothing except the word 'Home'
Please help as possible
Thanking you in anticipation
<i class="fa fa-home"></i>Home

You can quickly configure Joomla from stripping away your HTML tags by configuring your user groups ‘Filter Type’ to: ‘No Filtering’ or to your own preference for the respective Filter Groups.
By default JCK will strip the Glyphicons.
You can also set Global Config - Editor to 'none' which will do the same thing.
Personally I use JCE Editor which I find to be more capable.

Related

Correct way to get access to Dnn Stuff while using Modern 2sxc Hybrid Views

Now that my new views start with
#inherits Custom.Hybrid.Razor12
What do I need to do to continue to get access to Dnn Stuff when needed? I've been bouncing around the docs, but haven't spotted anything yet.
Are there compile codes that will let us do things like <### IF DNN ###>?
My specific need right now, and I am hoping someone can offer an example, is we always wrapped our module/View output like this
<div id="viewtype-#(Dnn.Module.ModuleID)">
</div>
And this allowed us to include some very module-targeted (non-leaky) CSS.
<style>
#viewtype-#(Dnn.Module.ModuleID) .navbar{
...
}
</style>
So then this sort of becomes two questions:
How do you do DNN specific things in a View properly?
What is the new-correct way to do the thing in the example above so that it would ALSO work on Oqtane? Do they have a Helper that would provide a unique ID at the same level as the View?
When you are editing a template, there is a menu at the left of the edit window. If you expand the <> you will see all sorts of helpers, DNN and otherwise.
And, the top icon expands to a list of all of the files/views/css that you might want to edit.
Or am I misunderstanding?
Oh, you don't have to do any of the <## xxxx ##> stuff any more. You can just refer to the DNN variables and methode (perhaps preceded by #) and just use them. After all, the template is a mixture of HTML and Razor stuff. The Razor stuff is darned close to c#.
So, you could drop something in like:
[p]
This is an example of using the portal id: #Dnn.Module.PortalID
[/p]
Note: < and > replaced by [ and ] so that they aren't interpreted as tags.

Link to an anchor on another episerver page

Is there an elegant way of linking to anchors in some other page in EpiServer that will keep the links relevant - even after the anchor names change? I am 95% sure there is no standard way of doing this, so thoughts on custom implementations are welcome.
There are existing plugins, but ...
I found this plugin to EpiServer that will basically scrape all the anchors from the page you are interested in, and present them in a drop-down in the TinyMCE wysiwyg editor. But as the anchors have no unique attributes that makes it possible to follow them through changes, these anchor links will rot in time, as changing <a name="Meeting"></a> to <a name="Appointment"></a> will make previously created links invalid.
Thoughts on how this could work
I am not super-familiar with how to easily work with ContentTypes in EpiServer, but I would assume it should be possible to create some kind of property, HtmlAnchors, that would be a collection of strings that could be employed on a page. These would be regarded as constants in practice, and I am quite certain that there is a way in EpiServer of checking if a page property is in use, so if one of these strings (HtmlAnchor) are referenced on some other page, it would be impossible to delete it without removing the references. That would make anchor links always be consistent and referable.
Possible workflow: An editor opens the page property view and presses the + sign on the "HtmlAnchors" property. Adds the string "detailed-overview". A front-ender working with code would then add something like that to the page template:
<h4 name=#Model.Anchors("detailed-overview")>Overview</h4>, and in referring pages use the (as of yet non-existing) url helper #Url.PageLinkWithAnchor(Model.PageLink, "detailed-overview") to create a link to that anchor.
If using a wysiwyg editor then it could use IAnchorPage#Anchors() to list the existing anchors and IAnchorPage#AddAnchor() to add an anchor.
Of course, I see how what I sketched out above seems to rest on a shaky foundation, as it uses simple strings ... which might not really add much else than overhead.

DNN - Custom Registration Form Field Does Not Validate for Required After Upgrade

I am upgrading a DNN site from version 5.06.00 to version 7.03.02. I followed the recommended upgrade path, and worked out all of the kinks with the custom modules. The registration form has a custom boolean field, which is required to be set to TRUE. This used to validate correctly pre-upgrade, but now it is not post-upgrade. The user can submit the form without selecting the "TRUE" radio button.
The custom field is displaying properly. The required asterisk is also displaying. The DOM even has an error message element with the correct custom required message:
<span class='dnnFormMessage dnnFormError'>[required message]</span>
However, this field is set to "display:none" by default and never displays as inline like the other error message elements.
I am not a DNN expert and I did not create this site. I am upgrading it for a client and don't know a ton about how these custom fields all work. I see the custom field enabled in Admin > Site Settings > User Account Settings > Profile Settings. I also see a file called "Profile.ascx.Portal-0.resx" that contains the custom field's main text, help text, and required text. It lives in DesktopModules\Admin\Security\App_LocalResources. I don't know what else I would need to configure or check that would be different from version 5.6 to 7.3.
Thanks for your help!
It seems like you've checked all of the requirements, but you didn't mention wheter or not the checkbox to require a valid profile for registration is checked. Is it?
Can you verify that the custom field is marked as Required?
It may be worth your while to upgrade to the current version of DNN 7, which is 7.04.02.
I'd recommend making a full site backup before doing the upgrade as that is always the right way to proceed.
The .resx file aren't going to affect the functionality, just the texts that are displayed.
I assume that you are doing much of this work on a test copy of the production site. That being the case, you might want to add another custom boolean field, make it required and see if that one works.
This isn't the ideal answer, but since I can't figure out what's wrong DNN-wise, I'm just writing some custom jQuery to find the checked radio button span element, then show/hide that error message based on that. If there is more than one thing wrong with the form, it will only show this message. Then if you corrected that boolean, it would show all other messages. It's not great, but at this point it's better than nothing.
$(".dnnPrimaryAction").click(function (e) {
var $checkedRadioSpan = $(".dnnRadiobutton-checked");
var $checkedRadioInput = $checkedRadioSpan.prev();
var $errorMessage = $checkedRadioInput.siblings(".dnnFormError");
if($checkedRadioInput.val() === "False") {
e.preventDefault();
$errorMessage.show();
}
else {
$errorMessage.hide();
// continue on with other validation
}
});
I had quite the same problem. It seems that the error message is not displayed for the first form item, as there is not enough place for it.
After adding a header (h2) above the form, it worked fine.
See Validator errormessage is not displayed in the DNN Community forums for more information.

CakePHP - Security - Image and Link Helpers

I just read this quite interesting post about security for CakePHP: Cakephp Security
It says that whenever a helper is used, CakePHP basically takes care security risks unless I turn of escape. I believe I only turn off escape when I want my links to be images, so nesting an image helper line inside a link helper line. For example:
echo $this->Html->link($this->Html->image('logo.png'), "/" , array('id'=>'logo', 'escape' => false));
Is that bad practise? Does that leave me vulnerable? Should I be doing it some other way?
Additionally, is it correct that whenever I output database data on dynamic pages, it needs to be enclosed in htmlspecialchars($myvariable)? I don't understand why I need to do that if I know that my database is clean from "bad stuff" and all of my forms for input into my database uses FormHelper.
In the example code shown you have all static values, no content coming from user so there's no risk.
Similarly for your content coming from database if for eg. all content is managed by site admin and no content from users is saved to database its reasonably safe to echo the content without escaping.

How to theme a menu block in Drupal?

This should really be a basic question but I simply don't get it after hours of searching. The question is, how do I theme menu blocks in Drupal 7?
I've created three different blocks all based on the main menu. Now I want to:
create unique HTML for all three blocks, that means modifing the surrounding wrapper and the <ul> and <li> that builds the menu. I wanna set special classes and remove all of the Drupal-added stuff
attach different classes to the different levels within each block. One of blocks will show two levels of the menu, i.e. it will display a submenu. I want to set a special class on the for the submenu...
This seems impossible... :(
Thank you in advance for the help!!!!
Theming is a tricky beast that often varies a lot depending what you need to do. Even with your very detailed description I can still say "it depends", but here are a couple steps that may help you get pointed in the right direction.
Step 1: Use a block tpl.php as suggested by Caffeine Addict. If you're not sure what to name the .tpl.php, I recommend the Theme Developer module. It's buggy, but you can use it to select an particular element and have it tell you suggestions for naming of .tpl.php files.
Step 2: Use a theme / preprocess function in template.php to modify the pre-defined variables and markup. Be sure to check on the theme_menu_tree & template_preprocess_menu_tree functions on api.drupal.org for starting points. If you're using the devel module, use dpm($variables); in each of those to see what you have to work with from the start.
I hope that helps! I agree with Caffeine Addict when he says that superfish might be an alternative. You should also probably check out the menu block module for breaking out conditional sub-sections into their own blocks.
In addition to what davidneedham said, to change what Drupal added to your menu HTML tags, you can override them. Here it is added classes:
<ul class="expanded">
<li class="firstleaf">...<li>
...
</ul>
i did not find a way to remove this classes, but you can override them in your block--system--main_menu.tpl.php file, like this:
li.expanded,
li.collapsed,
li.leaf {
padding: 0 0 0 0;
margin: 0;
}
ul.menu li {
margin: 0 0 0 0;
}
and then print your menu content:
<?php echo $content; ?>
I'm new in Drupal, wish my post can help you! :)
I would suggest to start with installing the Zen theme and follow the instructions inside the theme to setup a starter sub theme. This has all the information needed to learn theming in drupal and even how to add your own stylesheets etc.
This will allow you to start editing the templates for menu blocks and set your own html wrappers and classes.
For setting extra classes on blocks i would use this module:
http://drupal.org/project/block_class
Then just edit the block and you will see an extra section for adding additional classes to the block.

Resources