ZF1 Markup whiteline replacement - zend-framework

Since a couple of days I've been getting this strange error while using Zend_Markup Bbcodes. In simple words, the content which I'm trying to render will return with a lot of html elements. To be precisely, after all the < p > tags and all the 'n\' new lines are getting replaces by it.
When I'm dont render my content with the Zend_Markup renderer, its all good without any extra additional < br > tags.
I've been searching the interweb for a good fix, but it looks like no one else had this problem before :P. I'm guessing it had something to do with the filtering...
Example:
<p>Helloworld</p>
<p>And again Helloworld</p>
Will get returned as follow
<p>Helloworld</p>
<br>
<br>
<p>And again Helloworld</p>
<br>
<br>
Again, if turned off... everything goes like it should! But with out the great 'Bbcode' rendering functionality :'(
Thanks in advance guys!

Oke, after many hours debugging and doing tons of research and Google queries. I finaly solved my problem (for now and a bit dirty). It appeared to be a bug in the Zend Markup library cause of the fact that it was some last quick and rushed code right before one of the releases of ZF1. http://www.dasprids.de/blog/2010/02/28/why-i-am-not-using-zend_markup
Solution:
Comment out rule 312 in the Zend_Markup_Renderer_RendererAbstract class.
I will move in a little deeper into this subject when this project is finished. A quite a relief is that the Zend_Markup bug is or will get fixed in ZF2.

Related

Why don't the official FancyBox 4 bind examples work?

None of the bind examples in the documentation work - https://fancyapps.com/docs/ui/fancybox/api
The standard constructor examples work great, but anything that requires binding does not work. There is no error, but the gallery lightbox doesn't work - clicking an image just opens the image as a link. Here is the exact example code with markup:
<div id="gallery">
<a href="https://lipsum.app/id/1/800x600">
<img src="https://lipsum.app/id/1/300x225" />
</a>
<a href="https://lipsum.app/id/2/800x600">
<img src="https://lipsum.app/id/2/300x225" />
</a>
</div>
<script>
Fancybox.bind("#gallery a", {
on : {
ready : (fancybox) => {
console.log(`fancybox #${fancybox.id} is ready!`);
}
}
});
</script>
That console log never fires.
I'm importing FancyBox like this:
import { Fancybox } from '#fancyapps/ui';
I've tried searching around, but very little info on FancyBox 4 other than official docs and it's frustrating as they don't work. I've tried some of the examples in showcase also, and the same deal. If it's binding, it won't work and no errors are shown. Anyone have any insight into this?
Thanks,
Tom
It works perfectly fine. Since you did not provide a live demo (or at least a full HTML code), then it just not possible to help you.
It is so frustrating to read comments like this, no demo, no useful info, nothing. Maybe you did not include JS file, I do not know ... I would love to help you and to improve documentation, but, sorry, your comment is not helpful at all.
Fancybox is designed to be as easy to use as possible, all you have to do is:
Include two files - CSS and JS file (to get Fancybox object).
Add data-fancybox attribute to your links (or to call Fancybox.bind("YOUR_SELECTOR");)
Thats it! It can not be any simpler.
Sorry, it should have been a much clearer question. I didn't include a demo because it's a big wordpress site in production. It was giving me no useful feedback or errors or anything like that. I build websites day in and day out, so assumed it wasn't just me making some incredibly stupid mistake like a typo or something. I genuinely spent a lot of time on this, it wasn't me being lazy and just posting on stack overflow straight away...
It was me being stupid though.
In the process of making a demo to show you, I found the problem and (as you already know!) it's my mistake. I was able to make fancybox work by instantiating it straight away in my js, but binding (and therefore galleries etc) was not working.
The reason was the javascript was included in the head of the html document before the markup instead of at the bottom of the html document before the closing body. There was nothing for the js to bind to when it was executed.
I wouldn't normally include javascript in the head either but it's a wordpress project and because of some plugin, it's required there. Fancybox 3 worked with js in the head, but I suspect it might be jquery being more forgiving than native js with it's binding to DOM elements?
So, yes, entirely my fault. I was following the steps of the installation and startup guide almost exactly, but that inclusion of the js file in a slightly unusual (or bad practice at least) place was what caused all the issues.

What is 'partial' from a coding perspective?

I'm currently working through a geddy tutorial and came across a line of code:
<%- partial('form', {step: {}, toDos: toDos}) %>
What does partial mean? I've done a google search without much insight. I'm guessing it means that you partially load the content so the page loads faster?
Any explanations or helpful links would be appreciated.
http://geddyjs.org/tutorial
It's been a while since I've coded so if I should be looking at a particular method of coding (e.g. OOP, MVC) that I'm missing let me know.
I received this answer by Dan Craciun on experts exchange which answers it for me:
In geddy, a partial (denoted by a _ in front of the name) is a reusable file/template, that is meant to be used in more than one template. It helps share code between different templates.
See here for a longer explanation (about half page, "An intro to partials"): http://code.tutsplus.com/tutorials/creating-a-todo-list-app-with-nodejs-and-geddy--net-24535
HTH,
Dan
I am not sure, but in Symfony - partials are used in case that you have the some template, but there is a part that may be changed later (for example if you have the heading part of your html page, but the title will be different depending on what type of page it is).
So in order to keep the entire template and not break it into 2 parts, there are partials.

joomla accordion module with sortable headings

I have an issue with Joomla I've been battling with for a while now and I can't seem to see the answer. So I was hoping maybe someone out there might be able to help. First post so go easy on me.
I'm in the process of making a portfolio website for myself and can't seem to get my head around the SP_accordion module I'm using. I have it working and everything displaying everything it should and how it should.
I need, or should I say I also would like it to have a "header" with 3 columns that only effect the un-expanded accordion and are "sortable".
A perfect example of what I would like can be found #Jkarch.at
I have found an abundence of code for accordions and plenty of modules for joomla but I can't for the life of me find any help to create a 3 column accordion module for joomla 3. I'm not the most brilliant at web based applications or coding but I believe I can and usually do figure the most out myself but this is kicking my A*S.
So if anyone has a spare minute or to help it would be greatly appreciated...
Thanks again...
Chris.

Include vanilla file in Wicket?

It would be useful to be able to include some vanilla text files, containing simple scripts (with no HTML-relevant content), in an HTML page in my Wicket portal. There's no end to support for .css and .js, but I would just like to drop simple text inside a
<pre>
...
</pre>
paragraph so that I don't have to keep copying and pasting when these change. Or, am I in too much of a hurry and have asked the wrong question?
Profuse thanks for any and all comments.
Later, ...
The answer I got triggered it for me. It was just what I needed. Unfamiliar as I am with Wicket, this was pretty much over my head. However, thanks to the marvel of Google and a more knowledgeable friend, I was able to get this going. A pretty thorough description of my complete solution can be found at http://www.javahotchocolate.com/notes/wicket.html. Thanks to Nicktar!
Just give your pre-tag a wicket-id and fill it with a Label, setting EscapeModelStrings to false for the Label...

TinyMCE writes terrible HTML!

I've currently got TinyMCE incorporated into the backend editor of a simple blogging/page-editing app, but I'm extremely unhappy with the HTML code it creates. It does all sorts of messy things like:
Adding inline style information to span tags that you can't ever find to get rid of without editing the HTML directly.
Nesting tags in nonsense ways (e.g. <p><strong><p><span>some text</span></p><strong></p> just to make something bold.)
Adding empty <p> </p> lines where they don't belong and I'm not trying to create blank lines.
EDIT: I've looked at lists of the other editors out there (including on SO), but I want to know if people firsthand have had better luck getting clean code out of their wysiwyg editors.
Any recommendations for one that outputs better code behind the scenes?
How about a rather drastic alternative, and using a WYMIWYG (What You Mean is What You Get) editor rather that another WYSIWYG editor. That way the author is in full control of the schematic markup as well as the content he/she is entering.
Unfortunately I haven't found one that is as feature rich and usable as tinyMCE, but it seems to have come a long way - see http://www.wymeditor.org/demo/
Use HTML purifier before saving the content into the database.
HTML Purifier
I found JoomlaFCK to be a very good alternative to Tiny MCE.
Hope you like it.
bye
BTW I know it is an old thread but someone might use it. ;)