Description for inlined image field in django - django

After reading this post I'm wondering how to put a description text above the inline form to notice the user admin.
I also read this doc but I'm always stuck!
Thanks

You might be looking for help_text but I can't exactly tell from your question where you are expecting the text to show up
Edit: with regards to the comment below.
If you use StackedInline instead of TabularInline, your help text will show up.
If you really want your help text to show up on TabularInline, copy the template from
django/contrib/auth/templates/edit_inline/tabular.html
add field.help_text somewhere around the area to fit.

Related

How to display image here

Hi there, how can i display image here(its example place on the photo but it will be nice if i can put image here) from field Image but not after saving but live(when i paste url then display preview). I dont have any idea how to do that so the last thing is to write a question here.
Looks like you should use custom admin templates, then use JavaScript

Auto-Expanding TextAreas on PDF Generated from Django Template

I'm using pdfkit to generate a PDF of a Django template (doing this by getting an HTML string of the page from Django's get_template and render functions and passing that string to pdfkit... see post).
On this page, I have some TextArea's that can contain many lines of text, and by default, they just get cut off when generating the PDF.
I've tried to fix this by using some javascript libraries (I've tried several) to automatically expand the TextAreas on page load. I can get these to work perfectly on normal pages, but when I try to include it on the PDF template, I get various errors ranging from not working at all to expanding the TextArea way too much. My first assumption was that there was some styling differences that were causing the issues, but I'm fairly certain I've ruled that out. I tried to load the PDF template directly as a view, and the TextArea's resized correctly, leading me to believe that there's something with pdfkits generation that isn't playing nicely with the resizing.
Given this, I tried to look if pdfkit has any suggestions for issues like this and couldn't find any, and I also tried to use different input types other than TextAreas, none of which were able to display newlines correctly.
I can't think of any other potential solutions at this point, and I'm open to suggestions. Please let me know if you feel I should provide additional information, and thank you in advance.
I ended up finding a relatively simple fix. Because I was using django forms, I was pretty easily able to change from displaying the form Textarea:
{{ form.paragraph_data }}
to displaying just the plain text:
{{ form.paragraph_data.initial }}
However, this initially caused the newlines to not display correctly, because HTML doesn't process them in a plain string. So I added some processing in the creation of the form to replace the newlines with <br />s:
form.fields['paragraph_data'].initial = form.fields['paragraph_data'].initial.replace('\n', '<br />')
Finally, I had to add the safe filter to Django templating line to tell it to actually render the HTML rather than cleansing it:
{{ form.paragraph_data.initial|safe }}
Again, this was partially easy because of Django forms, but it should translate relatively easily to a more standard javascript/html solution.

Track down where content comes from

Being new to Joomla I do not know all the tricks for troubleshooting etc. Currently I have a page that has a section of content on it. The content is created by DT Register but I've been through the CP several times and cannot find the section?
I hope someone is up and can share with me how to track down where pieces of content come from so I can find where this is being generated and change as needed.
The page in question is a DT Register form. I can locate and modify every section of the page EXCEPT one.
The section is titled USER INFORMATION and captures userid & password to create an account. Looking at the element in developer tools it would appear it is part of the dt register generated code but as I mentioned I can't find it.
The sandbox I am playing in is here: http://take7.lamplighterguild.com/index.php/register?eventId=15&controller=event&task=individualRegister
The section is towards the top and is hard to read on the page...which is why I want to find it.
Thank you for any help or direction.
So unfortunately my question was poorly worded. I have no trouble at all getting the css changed. It is the origin of the content that I am really trying to track down. Where does it come from etc. Is there a way to detect if it came from an article, or a component, etc. I thought there might be clues as how to figure that out.
For troubleshooting issues like this, tools like Firebug or Web Inspector for Chrome and Safari are your go to tools. If you aren't already familiar with them you'll find lots of help online.
There is default body text styling of colour #D9A362 getting into your page from one of the stylesheets. I can't find the source quickly myself, though it's easy enough to write an override.
One place you could do this is open http://take7.lamplighterguild.com/templates/theme1001/css/template.css with a text editor. Below the existing body rule # line 7, add something like
body.cssstyle-style1{
color:black;
}
This will fix the H2 text at the top of the page which you mention, plus the 'user information' line immeadiately above the form.
Hope this helps!
EDIT
You have something which is writing the following style to your page head and this is the culprit:
body {font-family:Arial, Helvetica, sans-serif; font-size:13px; line-height:21px; color:#D9A362; }
It's even on your home page so it's not necesaarily related to DT Register. To me it looks like it's coming from your menu extension.

OpenCart removes line breaks from description

I have a Opencart site that has free and paid code packages. I have been trying to find where in the code it is removing my line breaks. If you enter code into the text editor it saves the line breaks into the database.
When you go to edit the product it has removed all the line breaks when the page loads. Does anyone know where this can be fixed. My first thought is the WYSIWYG editor but I am lost on how to prevent this from happening.
Anyone know what file is causing this glitch.
Edit: If we cant fix the editor does anyone know what file contains the form for adding/editing a product so i can remove the id and just use the textarea
I have heard of this problem before... it is caused by ckeditor... you can remove ckeditor and paste raw html into the text area if you like... alternatively you could use a separate WYSIWYG editor such as tinymce or similar... look here for a few options http://www.1stwebdesigner.com/design/10-best-wysiwyg-text-and-html-editors-for-your-next-project/ or here Alternatives to CKEditor for WSYIWYG text area editor
Contact me if you need help installing any of them

Is there a way to format article layout on joomla?

How can I format article's layout...
For example I would like to display the first image on top under the title but, on the left of the text I would like a column with the date, hits, author name and pic, and any other stuff I like to have there...
Is it posible?
Thanks again for your time and help.
You could check out Joomla overrides. Here's one link to get you started:
http://bit.ly/Z97yls
Hope this helps!
For what I understood of your question, you can easily do this with CSS classes - use google chrome to inspect the code.
Also, there is a amazing component called Modules Anywhere that you can use to insert any module inside your articles page.