Page 1 of 1

FIXED - r398: No frontend edit button

Posted: Wed 17. Feb 2010, 14:24
by antonumia
hi all,
I can't seem to get my frontend edit button to appear
I've set it in the config.

btw: I'm using jquery if it makes any difference.


puzzled,

anton

Re: r398: No frontend edit button

Posted: Wed 17. Feb 2010, 14:58
by flip-flop
Hi,

there is no different for me. Running well with MooTools or jQuery in v1.4.5 r400.

- Is this snippet available for you: template/lib/jquery/plugin/jquery.switchClass.js
- is this snippet loaded in the frontend with activated FE-edit?

Knut

Re: r398: No frontend edit button

Posted: Wed 17. Feb 2010, 16:17
by antonumia
hi,

yes the snippet is there but isn't loaded in the FE.
I've added it into my template just to check - nothing...

Re: r398: No frontend edit button

Posted: Wed 17. Feb 2010, 16:48
by flip-flop
config:

Code: Select all

$phpwcms['SESSION_FEinit']    = 1;
$phpwcms['frontend_edit']     = 1;
Source FE jQuery:

Code: Select all

  <script type="text/javascript" src="template/lib/jquery/jquery-1.4.min.js"></script>
  <link href="template/inc_css/specific/frontend_edit.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript">
  <!-- 
	jQuery(document).ready(function() {
		$("a.fe-link").toggle();$("#fe-link").click(function(){$(this).switchClass("enabled","disabled");$("a.fe-link").toggle();});
	});
  //-->
  </script>
Source FE MooTools:

Code: Select all

 <script type="text/javascript" src="template/lib/mootools/mootools-1.2-core-yc.js"></script>
  <link href="template/inc_css/specific/frontend_edit.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript">
  <!-- 
	window.addEvent("domready", function() {
		var felink_status = 0;
		$$("a.fe-link").each(function(r) { r.setStyle("display", "none"); });
		$("fe-link").addEvent("click", function() {
			if(felink_status == 1) {
				$$("a.fe-link").each(function(r) { r.setStyle("display", "none"); });
				$("fe-link").removeClass("enabled"); $("fe-link").addClass("disabled");	felink_status = 0;
			} else {
				$$("a.fe-link").each(function(r) { r.setStyle("display", ""); });
				$("fe-link").removeClass("disabled"); $("fe-link").addClass("enabled");	felink_status = 1;
			}
		});
	});
  //-->
  </script>
But the best of all, we don´t need JS for FE-Edit !!!

Please don´t put any snippets into a template for FE-Edit!!!

I think your installation is not quite i.o.

Knut
Knut

Re: r398: No frontend edit button

Posted: Thu 18. Feb 2010, 14:57
by antonumia
hi Knut,
thanks.
That breaks all my other jquery stuff
I suspect you are right about the installation. Was an upgrade from 1.4.2
I will do a directory compare to see what happened.

Re: r398: No frontend edit button

Posted: Thu 18. Feb 2010, 15:17
by flip-flop
In mind:

since r381 it can be problematic to run a JS lib using this call:

Code: Select all

$GLOBALS['block']['custom_htmlhead']['jquery-XX'] = '  <script src="'.TEMPLATE_PATH.'inc_js/jquery/jquery-XX.js" type="text/javascript"></script>';

The new one e.g.:

Code: Select all

initJSPlugin('jquery-XX');

with a file in
/template/lib/jquery/plugin/jquery.jquery-XX.js

The main lib is automatically loaded if you run a initJSPlugin (If you have switched the right main-lib in template)!!

Knut

Re: r398: No frontend edit button

Posted: Thu 18. Feb 2010, 18:24
by Oliver Georgi
Check your template and enable the correct JS library. Be aware when using a jQuery extension that is not compatible with 1.4.x

Re: r398: No frontend edit button

Posted: Thu 8. Apr 2010, 00:27
by phalancs
The FE-setting:

$phpwcms['frontend_edit'] = 1;

should have the hint included in the comment that it needs the "FEsessions" activated!!!

$phpwcms['frontend_edit'] = 1; // blabla activate FEsessions in this config file

Re: r398: No frontend edit button - FIXED

Posted: Wed 12. May 2010, 12:56
by antonumia
The problem is that I put all my js includes in the html head section of my templates.
jquery is loaded after the html head additions = $ is undefined