Jump to content

Using HannaCode with the Table field


Recommended Posts

Hi all,

I've got a Table field on one of my pages. The first column requires the use of Hanna Code so I can add custom icons to the table cell. As per the settings for that particular field, I've set the textformatter option as TextformatterHannaCode (as the screenshot will show, for this particular field it's not possible to just select text formatters from a select dropdown. Instead I have to type in the value).

Now, if I manually type in my HannaCode label (e.g. [[icons_copy]] )  then it will output correctly onto the page, but I need to also have the HannaCode selection menu which normally shows up in CKEditor when right-clicking in the textarea field. Does anyone know how I can achieve this? Do I need to apply a different setting in the Settings area as shown in the screenshot?table_settings.png

Link to comment
Share on other sites

Maybe consider using a javascript select such as Selectize.js; you could init those fields and let selectize get the options from a custom js array... that's probably the only way to make an icon select in a column of table without actually making it a page select or options;  Plus you could actually show the icon when using  a select and store the class as the value; when rendering i don't think you'd need bother with hanna code, you could just output the icon.

Link to comment
Share on other sites

ok here is a sample function that i'm using to init selectize on a table field:

	$('li.Inputfield_table_field tr').each(function(){

		var selOpts = new Array();
		// add stuff to JS your array here...

			delimiter: ' ',
			persist: false,
			maxItems: 1,
			options: selOpts,



so for example, you would need to be using AdminCustomFiles module and then this would be inside the ProcessPageEdit.js

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By nabo
      it would be nice if it could be possible to force a unique (or relative) imagefield for CKEditor.
      Using a repeater matrix (or repeater) with CKEditor field, the primary sources for images are imagefields in the page-repeater fieldset. Obviously I can change the page source, but I need to start from the root and this is not comfortable. In this specific situation the better solution is to have an imagefield in the parent page and force CKEditor to automatically go there... or if you want to have a "media library" go there first.
      Don't know which could be the best "setting system" but in my opinion this is an annoying problem.
    • By fruid
      I'm trying to pass a variable from one hannacode occurence to the next.
      hannacode: [[nextimage]]
      if (isset($next)) : $next++; else: $next=0; endif; $nextimage = $page->images->eq($next); echo '<img title="'.$nextimage->title.'" alt="'.$nextimage->title.'" src="'.$nextimage->url.'"/>'; But everytime the hannacode runs, it's a different scope so to say.
      Any ideas?
    • By fruid
      inserting links i.e. <a>-elements, and only links, inside a CKEditor-summary field outputs the link-text and a weird " /> above the content-div (I'm using markup regions).
      I have no idea where this is coming from, all the other tags work perfectly, and the CKEditor-markup is fine too when adding links. It puts the <a>-element inside a <p> element but should be alright?
      Any hints?
    • By Greg Lumley
      Hi, this has me stumped, please help. 😳

      I'm using a field 'page_body' in a page-template as well as a blog-template. 
      HannaCodeDialogue is enabled for the field page_body.
      HannaCode works perfectly in Pages but not in Posts. 

      The dropdown is visible in the pages edit template but not in the posts edit template. 
      If I manually put the code into the Posts Template i.e. : [[YouTubeVideo videoName="my_vid"]] it simply displays the tag. 
      I'm quite sure this is a config error of some sort but for the life of me, I can't find it. 
      Thank you. 
  • Create New...