Posts: 55
Threads: 13
Joined: Jul 2013
I do all my coding in Sublime Text 2 and then paste it into the HTML Editor using the source tab.
The problem that I am having is the code gets changed, for instance;
<a tabindex="1"><?php get_site_url(); ?><img src="<?php get_theme_url(); ?>/img/orchid.jpg"></a>
becomes
<a tabindex="1"><!--?php get_site_url(); ?--><img src="<?php get_theme_url(); ?>t;/img/orchid.jpg" /></a>
basically it's <?PHP becomes <!--?php and ?> becomes ?-->
Even if I manually code it into the editor, it will change as soon as I hit save.
I am using v3.2.3.
The wiki suggests creating a config file for this but,never having created a config file, I wouldn't know where to start. Are there any settings that address the sort of problem I am seeing and how would I implement them.
thanks for your help.
I'm no Einstein, nor do I profess to be. Just saying what I would try in the circumstances.
Posts: 6,266
Threads: 181
Joined: Sep 2011
You cannot put php in page contents.
Posts: 55
Threads: 13
Joined: Jul 2013
Well, that certainly explains that one Shawn
So I need to write my path in full?
thanks
I'm no Einstein, nor do I profess to be. Just saying what I would try in the circumstances.
Posts: 6,266
Threads: 181
Joined: Sep 2011
Depends on what you are trying to do.
Could go in a new template in your theme, could go in a component.
You can use dynapages plugin to add component shortcodes.
Posts: 55
Threads: 13
Joined: Jul 2013
I found this nice gallery that I want to add
alpatriott.ru/works/album/album-mod.html
Basically, the HTML code is
<div class="gallery">
<a tabindex="1"><img src="http://mysite/theme/mytheme/img/image1.jpg"></a>
<a tabindex="1"><img src="http://mysite/theme/mytheme/img/image2.jpg"></a>
<a tabindex="1"><img src="http://mysite/theme/mytheme/img/image3.jpg"></a>
<a tabindex="1"><img src="http://mysite/theme/mytheme/img/image4.jpg"></a>
</div>
I was trying to add it to a blank template page.
The images will all be in the same folder (obviously) so I don't want to keep adding the full path.
I want to be able to quickly go in and change the image if necessary.
I don't necessarily want to use someone elses plugin, I want to use it as a learning tool. My PHP is lacking somewhat
thanks
I'm no Einstein, nor do I profess to be. Just saying what I would try in the circumstances.
Posts: 6,266
Threads: 181
Joined: Sep 2011
Just use relative urls.
../../data/uploads/
Or something like that
Posts: 3,491
Threads: 106
Joined: Mar 2010
@lucianp
I think you mean something like this:
Code: <?php
$myimages = array('image1.jpg','image2.jpg','image3.jpg','image4.jpg');
?>
<div class="gallery">
<?php foreach($myimages as $myimage) { ?>
<a tabindex="1"><img src="<?php get_theme_url(); ?>img/<?php echo $myimage; ?>"></a>
<?php } ?>
</div>
(Not tested.)
Posts: 55
Threads: 13
Joined: Jul 2013
Thank you Shawn and Carlos,
having thought a bit harder and a bit longer about what I am trying to do, I realized I would need a backend for image manipulation, so I added a plugin to my site and will use that to learn from.
I'm beginning to see PHP can be fun
I'm no Einstein, nor do I profess to be. Just saying what I would try in the circumstances.
Posts: 12
Threads: 1
Joined: Dec 2013
Hello,
I have a similar problem.
I want to use FontAwesome icons as bullets in a unordered list environment, but when I paste this code into the HTML editor:
Code: <ul class="fa-ul">
<li><i class="fa-li fa fa-hand-o-right"></i>Current teaching info</li>
<li><i class="fa-li fa fa-hand-o-right"></i>How to get to my office</li>
</ul>
the smart editor transforms it into this:
Code: <ul class="fa-ul">
<li>Current teaching info</li>
<li>How to get to my office</li>
</ul>
Is there any way to prevent the smart editor from "cleaning" the code??
Is there any way to disable the smart editor, and to work only with raw HTML?
--
vicent
Posts: 3,491
Threads: 106
Joined: Mar 2010
(2013-12-11, 16:41:28)vginer Wrote: Is there any way to disable the smart editor, and to work only with raw HTML?
Yes: go to Settings and untick "Enable the HTML editor"
Posts: 12
Threads: 1
Joined: Dec 2013
(2013-12-11, 16:50:26)Carlos Wrote: (2013-12-11, 16:41:28)vginer Wrote: Is there any way to disable the smart editor, and to work only with raw HTML?
Yes: go to Settings and untick "Enable the HTML editor"
@Carlos, thank you!!
And another one: Is there a way to change the default font (Arial-like) of the raw HTML editor (to a monospaced one)?
--
vicent
Posts: 6,266
Threads: 181
Joined: Sep 2011
Ckeditor removes empty tags
There is a way to fix this, but youll have to search the forums.
Posts: 6,266
Threads: 181
Joined: Sep 2011
See
http://ckeditor.com/forums/CKEditor-3.x/...ty-tags-eg.
I do not think this is fixable in our cke version.
You might want to try the cke patch branch of GS which runs cke4+, it might be more html5 friendly.
Posts: 6,266
Threads: 181
Joined: Sep 2011
Actually never mind
Fixed
CKEDITOR.dtd.$removeEmpty.i = 0;
Add that to your config.js, you can also add .span etc.
Posts: 6,266
Threads: 181
Joined: Sep 2011
To modify the plaintext textarea, use the custom admin css plugin
Code: textarea#post-content {
font-family: Consolas, Monaco, "Courier New", Courier, monospace;
tab-size:4;
-moz-tab-size:4;
-o-tab-size:4;
}
Posts: 12
Threads: 1
Joined: Dec 2013
(2013-12-12, 01:25:23)shawn_a Wrote: Actually never mind
Fixed
CKEDITOR.dtd.$removeEmpty.i = 0;
Add that to your config.js, you can also add .span etc.
Thank you! So, do you mean this is already solved??
--
vicent
Posts: 6,266
Threads: 181
Joined: Sep 2011
Thats the solution, works for me.
Might need to test it in your scenario, I only tested it on the beta version, not stable.
Posts: 12
Threads: 1
Joined: Dec 2013
(2013-12-12, 01:28:17)shawn_a Wrote: To modify the plaintext textarea, use the custom admin css plugin
Code: textarea#post-content {
font-family: Consolas, Monaco, "Courier New", Courier, monospace;
tab-size:4;
-moz-tab-size:4;
-o-tab-size:4;
}
Thank you. I installed Custom Admin CSS, and used your code in order to customize the text area appearance. At the beginning it didn't work, at least on my browser (Chrome), but I removed all carry returns and it worked!
--
vicent
Posts: 6,266
Threads: 181
Joined: Sep 2011
Did you try the ckeditor fix yet?
Posts: 12
Threads: 1
Joined: Dec 2013
(2013-12-13, 00:23:13)shawn_a Wrote: Did you try the ckeditor fix yet?
No, I finally decided to disable it after reading several posts in the forum, because that way I am sure that my code is not altered.
Thank you anyway.
--
vicent
|