Yiidoc yoi2-redactor and kartik fileInput - yii2

I would need a little help ^^ i have a form with several file upload ( kartik/file/fileInput) and several rich textareas ( yikdoc/yii2-redactor)
And my problem is that if i don’t have the redactor, everything works, but if i have the redactors, no files are uploaded, and with a var_dump i see the variables empty…
Any idea what is the problem?
You can see my form here
code is to long so see it in codeshare. https://codeshare.io/qPbovR
and you can see my conroller here
code too long too. https://codeshare.io/RbVj34
you will see in the form that i had to duplicate fields for descriptions and use jquery to add the "redactor" content to a hidden field, other wise iit's not working, but if i don't use redactor, i don't need those.
Thank's for your help :)

Related

Changing number of a web page (in the URL), change the display but not the Html source code

I am facing a behavior that I really don't understand.
If you go on the webpage: https://www.edel-optics.fr/Lunettes-de-soleil.html#ful_iPageNumber=1 and inspect the code you will realize that it's the same html content as on https://www.edel-optics.fr/Lunettes-de-soleil.html#ful_iPageNumber=7
=> to test it, try to search "ERIKA - 710/T5" on both source codes and you will find it (but you should only find on the ful_iPageNumber=1).
Why is it behaving like this ?
Secondary question: how to I get the real content of https://www.edel-optics.fr/Lunettes-de-soleil.html#ful_iPageNumber=7 ?
Thank you for your help
John
Problem
You have explained that when you perform a search, you get the same results as with your pagination (page 1)
Issue
You are not getting the value your searching for placed into the URL
https://www.edel-optics.fr/Recherche.html?time=1519871844737#query=
the #query is = to nothing
You would be needing something like:
https://www.edel-optics.fr/Recherche.html?time=1519871844737#query=ERIKA%20-%20710/T5
Without seing your code its hard to say where the issue lays. it could well be that the search box is not inside the Form or it could be that the submit button is on another form to the search box, or maybe an issue with backend scripts not grabbing the get values as a result of case differences in the value name.
Without seing your script its hard to diagnose
Ok I found a solution to solve this strange problem, replace the # in the URL with a ? and you will have the actual html content (corresponding to the display)...

Inserting or copy/pasting picture to a textbox

I have a file with a textarea (named "Resolution support") in which you can explain how to solve a problem. My problem is that a user would be able to add a picture for a better explaining. If he copy/paste or he has to click and drag or anything i don't care, he HAS TO be able to put a picture into the textarea.
I wondered if another textbox that can do this would exist and what Type does the textbox has to be in PhpMyAdmin.
My textarea :
<textarea name="Escalade" class="longInput" cols="80%" rows="19" wrap="hard">
</textarea>
Without some kind of JavaScript WYSIWYG library this is not possible as vanilla textarea only takes text (clue is in the name).
I assume that you are viewing the submissions in phpMyAdmin which is an interface onto a MySQL database. It is good for developing stuff but not so great as an admin user interface long term. What you are asking about are called transformations.
Here are some tutorials on storing images in a database:
http://www.hockinson.com/programmer-web-designer-denver-co-usa.php?s=47
http://w3schools.invisionzone.com/index.php?showtopic=48068
How to store file name in database, with other info while uploading image to server using PHP?
Here are some lists of WYSIWYG editors:
http://www.sitepoint.com/html5-wysiwyg/
https://github.com/cheeaun/mooeditable/wiki/Javascript-WYSIWYG-editors
Those phpMyAdmin transformations:
http://docs.phpmyadmin.net/en/latest/transformations.html
That is about as much help as can be offered to you without seeing the PHP code behind the form at the very least. Hope this helps.
If someone is looking for an answer, I had asked my profesor and he answered that what I was looking for is a "Rich Text Editor". I'm using ckeditor with the plugin prgfilemanager. It allows me to insert pictures but I cannot copy/paste them which is pretty annoying...
You can try it here http://ckeditor.com/demo I hope it will help you if you have the same problem that I had :)
While it is true that you cannot use a textarea, the answer is very simple. You can use a content editable div, grab the contents as html and write it to a databae using AJAX and PHP.
Just name a div like this:
<div class="my_article" contenteditable></div>
and pass the contents on the click of a button into a JS variable and then pass that into PHP using AJAX.
var content1 = $('.my_article').html();
If anyone needs further help please comment and I'll be happy to obligue.

django-displaying data the way they are entered by the user

I have a models.py file where i have a textfield
models.py
class xyz(models.Models):
abc=models.TextField()
I am using html form to save the data for the abc field.
The problem is that if i enter the data in multiple lines in the form and try to display it, the whole matter is displayed in a single line.
So what is the error?
Is it in the models or what?
Thanks in advance.
The user enters a plain text, and than you are trying to show it as HTML. these are different formats.
There are a lot of possibilities, the simplest one is to let the user enter HTML and than everything will work as expected.
To do this, use some HTML editor like tinymce
Other solution is to use some markup formatting

MediaWiki : is it possible to add an edit link in a template?

I have a template on my wiki, kind of a box template.
Then, there is this page where I use it several times.
Can I add an edit link to each of the boxes so I don't have to edit the whole page in order to modify one of the boxes?
The boxes contain only text, not other templates.
Thanks!
Edit: Actually there's an easier way to ask my question:
Let's say I have a page without sections defined (namely without == titles ==):
content A
content B
content C
Is there a way to open an edit form only for content B?
"Is there a way to open an edit form only for content B?" - in standard mediawiki - no, but you can do sth like this
Main page will look like this:
{{/subpageA}}
{{/subpageB}}
{{/subpageC}}
subpageA will contain link to edit subpageA etc
But it is worse than sections in every possible way.
If I understand your question, and I'm not sure I do, I'm assuming your box is a div or table of some sort? If so, you could add id="{{{1|Some identifying parameter}}} to it.. Now, similar to if you had used == header 2 == you will be able to link to that section of the page with [[{{PAGENAMEE}}#{{{1|Some identifying parameter}}}]]. The only trick is to edit that section. You would likely have to set up a <span class=plainlinks>[http://somewiki.com/edit/{{PAGENAMEE}}&section={{{1|Some identifying parameter}}}]</span> Although, I'm not sure using the section name will work on your wiki, it works on only one of four that I edit. The other three require the section number, which may be harder to figure out, or at very least is beyond my pay-grade atm..
Not sure what you're asking here. Do you want to edit the template from the referring page?
Update:
One: The ugly but simple solution:
Add the following code above the text you want to edit:
=== ===
This will create a section with no name, but with an edit link. If you make four or more of these links, you will create a TOC in the page. You can suppress this with:
__NOTOC__
Two: The neat but extensive solution:
Make your wiki semantic and use Semantic_Forms to edit the page using a form.
Not with the standard installation.
But, I'm sure you could write an extension to do this. Eg. Right click on the page and it will start editing there.
It is possible to add link to edit template, so you can make ugly hack and create separate templates/subpages for every single box.

Text formatting within textarea

Variations on my problem have been discussed elsewhere, so I hope I'm not duplicating!
I'm implementing a simple Private Messaging System as part of a web app. I've got an annoying problem though when dynamically inserting text into a textarea box in order to make a reply. Getting the content and displaying it is fine, but I can't work out how to format it correctly.
Obviously, I can't use html tags, but plain text formatting like line breaks and carriage returns seem to be ignored too.
This happens when an existing message is being displayed either as part of a reply or as a thread in a new message.
How do I check what formatting is being saved in my db? Or indeed what formatting is being sent back from my db?!
What about using some for of HTML editor for the replies. Save the html in the database and shown them again in the editro on your web site.
Check this wiki page for a list of possible editors
UPDATE:
Thanks for your replies, but I've worked it out. I was playing around and realised the problem was at the stage of sending the data to the db. I passed the text through the nl2br() function before sending it to the db and this seems(!) to have done the trick!