Keyword

How to shift content on a page please

  • Tim Payne
  • Tim Payne's Avatar Topic Author
  • Offline
  • New Member
More
10 years 9 months ago #123970 by Tim Payne
How to shift content on a page please was created by Tim Payne
Working on a site for a filmmaker friend.
Have a category created in Catalog view that shows an image of each completed project.
When that image is clicked visitors see the content of the Extra Fields, with the media content below it.

www.amandatrudellpro.com
Click Projects menu item
Click the featured item for an example

What we want is the embedded video to be at the top of the page and the Extra Field text directly beneath the video. This way the visitor does not have to scroll down in order to watch the video.

Thank you!

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 9 months ago #123971 by Yiota
Replied by Yiota on topic Re: How to shift content on a page please
What you need to do is to create K2 template overrides (read here getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates how to do so)
Then modify the item.php file and move the video block right above the extra fields block.

Please Log in or Create an account to join the conversation.

  • Tim Payne
  • Tim Payne's Avatar Topic Author
  • Offline
  • New Member
More
10 years 9 months ago #123972 by Tim Payne
Replied by Tim Payne on topic Re: How to shift content on a page please
thanks for your suggestion. I followed the tutorial, and I see my template name now as in option under categories.

However, I am a little confused in that the original default.php file is under template/MYTEMPLATE/html is a folder called mod_k2_content. Inside this folder is a Default folder, and in that is the default.php file where I can make the edits needed to place the video above the other fields text.

Not quite sure how to get the template I created to point to my edited version of default.php.

Thanks!

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 9 months ago #123973 by Yiota
Replied by Yiota on topic Re: How to shift content on a page please
The paths for the modules are a little different for the overrides from the component's.
For the mod_k2_content you need to have this folder path in your template folder
templates/your_template/html/mod_k2_content/Default/...

Then edit the default.php file as you like.
You can also create sub-templates for the mod_k2_content as well. Just duplicate the Default folder in your template folder and rename it with something different which you will then assign accordingly to the mod_k2_content module in the backend.

Please Log in or Create an account to join the conversation.

  • Tim Payne
  • Tim Payne's Avatar Topic Author
  • Offline
  • New Member
More
10 years 9 months ago - 10 years 9 months ago #123974 by Tim Payne
Replied by Tim Payne on topic Re: How to shift content on a page please
Okay, this is what I have determined through your suggestions and a little trial and error. However, the end result is that my page did not change after editing the default.php file. Most likely because I am not doing something correctly.

Folks with this post, these steps are not complete or tested. Just trying to flush out my original issue.

Step 1: I locate the folder /components/com_k2/templates/. Inside this folder is a folder called "default"
Step 2: Create a new folder in inside /components/com_k2/templates/. Call it "tp_test" for example.
Step 3: Copy the contents of the "default" folder into the "tp_test" folder.
Step 4: Locate the \templates\mod_k2_content folder.
Step 5: Create a new folder hear with the same "tp_test" name.
Step 6: Copy the contents of the "Default" folder to the "tp_test" folder. this is one file called default.php.
Step 7: Edit the default.php file in the "tp_test" folder.
Step 8: Go into Categories in K2 and change the template to the tp_test, save, and view your site.

Provided that the steps above are correct, and none of the various file in these folders need editing, please review the attached original default.php file and show me specifically how to have the video display before the ExtraItems text.

Thank you,
Attachments:

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 9 months ago #123975 by Yiota
Replied by Yiota on topic Re: How to shift content on a page please
First of all I never said that you need to copy anything inside the components folder. All sub-templates for both the component views and the module's should be done in the template's folder.

The correct steps for the K2 component views override

1) You create a folder named com_k2 under templates/your_template/html/
2) You copy the contents FROM components/com_k2/templates folder
3) You paste the contents in templates/your_template/html/com_k2 folder.
4) If you need to create another sub-template to use in your component's views you copy the default folder located in your template folder in the same path with a different name.
5) All modifications can be done to these files under your template's folder

The correct steps for the K2 module override

1) You create a folder named mod_k2_content under templates/your_template/html/
2) You copy the contents FROM modules/mod_k2_content/tmpl
3) You paste the contents in templates/your_template/html/mod_k2_content folder.
4) If you need to create another sub-template to use for your module's views you copy the Default folder located in your template folder in the same path with a different name.
5) All modifications can be done to these files under your template's folder

I hope everything is clear now.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum