- Posts: 71
COMMUNITY FORUM
k2 background image
- Moustakakis
-
Topic Author
- Offline
- Senior Member
I would like to change the default background color in k2 article and I would like to replace it with an image and then write my article.
I attach to you an image to see how I would like to be. Is it possible something like this and how can I do it?
Best Regards.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Then in your templates you will need to output the value of the plugin (possibly the image url) and use a simple JS script to use this image as the background of the body element.
A good starting point is: getk2.org/extend/extensions/90-example-k2-plugin-for-developers
Alternatively you can use css to specify the background image.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Moustakakis
-
Topic Author
- Offline
- Senior Member
- Posts: 71
Regards.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
If my memory serves me right this plugin outputs code for a video gallery, right?
You need to look for the $output variable.
Possibly you also need to strip some excess code as well in your case.
Eg. That YouTube part has got to go.
Once you get a clean $output (only the image url) then you can use Joomla!'s API - docs.joomla.org/JDocument/addScriptDeclaration - to add a small jQuery script which alters the css of the body element and adds that image as background. - api.jquery.com/css/
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Moustakakis
-
Topic Author
- Offline
- Senior Member
- Posts: 71
I have added the following javascript.
jQuery(document).ready(function(){
var page = "about";
var classSS ="regionover";
var url = window.location.href;
if(url.indexOf(page)>0)
{
jQuery("#region3wrap").addClass(classSS);
}
});
and I add the following lines in my template.css
.regionover
{
background: url("/images/about/about.jpg");
background-repeat:no-repeat;
background-size:100% 100%;
}
but it doesn't function.
Could you help me more?
Best Regards.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Please Log in or Create an account to join the conversation.
- Moustakakis
-
Topic Author
- Offline
- Senior Member
- Posts: 71
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Please Log in or Create an account to join the conversation.
- Moustakakis
-
Topic Author
- Offline
- Senior Member
- Posts: 71
I solve it.
I have only a problem with responsibility.
Thank you.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Please Log in or Create an account to join the conversation.
- Moustakakis
-
Topic Author
- Offline
- Senior Member
- Posts: 71
Responsive design view.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
background-size:cover;
Please Log in or Create an account to join the conversation.
- Moustakakis
-
Topic Author
- Offline
- Senior Member
- Posts: 71
Would you like to send you more information to take a look if you can help me?
Best Regards.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Thank you
Please Log in or Create an account to join the conversation.
- Moustakakis
-
Topic Author
- Offline
- Senior Member
- Posts: 71
Please take a look to the website iml.cmnet.gr/index.php/k2-media
I attach to you an image that describe in brief the problem.
I will appreciate if you can help.
Best Regards.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
#region3wrap.regionover {
background: url("/images/about/about.jpg");
background-size: cover;
margin-top: -15px;
background-position: 50% 50%;
}
This will solve your issue in responsive states.
Please Log in or Create an account to join the conversation.
- Moustakakis
-
Topic Author
- Offline
- Senior Member
- Posts: 71
The main problem is the text that it is not responsive. This I try to send you with one screen.
please check it with fierox web developer --> responsive design view (ctrl+shift+M)
Thank you.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Please Log in or Create an account to join the conversation.
- Moustakakis
-
Topic Author
- Offline
- Senior Member
- Posts: 71
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Then the text box is resizing properly when you see it in smaller screens.
What you should also remove is the margin-top:-15px from #region3wrap.regionover also for the mobile devices.
I think you need to ask your template developer to better help you with this one.
Please Log in or Create an account to join the conversation.