display image for course

Re: display image for course

by abhishek bhattacharjee -
Number of replies: 5

thanks richard 

i will go through ..

In reply to abhishek bhattacharjee

Re: display image for course

by abhishek bhattacharjee -

hello richard 

i went through the theme you made with some other indispensable people its really awesome theme i exactly want to display the course as you have diplayed in square boxes with the pictures ......i went through  flexibase/renderers/course_renderer.php  and flexibase/renderers/course_overview_block_renderer.php  even the layouts/includes/mainbody.php 

i have created a custom front page in which i need the pics and the title how should i call the function from   flexibase/renderers/course_overview_block_renderer.php  the following function  protected function activity_display($course, $overview){.....}

present in line number 246 i guess that only will display the overview file which has the image

thank you in advance

In reply to abhishek bhattacharjee

Re: display image for course

by abhishek bhattacharjee -

i found that $OUTPUT->content_main() prints the pictures of the course and everything the div which is used there for the image doesn't display any image ..below i have attached a file of the header.php which isn't working how can i get that work for front page not showing any wrrors just not displaying images

need a serious help on this anybody please thank you

Attachment cimage.png
In reply to abhishek bhattacharjee

Re: display image for course

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

But those 5 lines - while they are the lines that print the image to the page - are only a tiny part of the code in my theme, which incorporates theme settings, course summary files, a renderer as well as the layout files.

How have you adapted and used the rest of the code?

What errors are you getting?

I know the code in its original form works (can be seen in flexibase) so what have you migrated to your theme? Have you moved or adapted everything, or are you missing a tiny but vital piece.

Also, that particular piece of code is for using the course summary file (image) as a header image in the layout file, not in the course tile as part of Available Courses which is what you were asking about - that display of the course image in the course tile is done through the course_renderer and css (and so would be output as part of $OUTPUT->main_content() ).

If you have got as far as your image being output (in the html) through main_content as part of the available courses, then the rest is down to the css to actually display it and style it in the tiles the way you want them and for that you will need to look at the style files in flexibase, or another theme that uses the course tiles. Mine are bootstrap3 and use panels and flexbox layout which may not be suited to your theme - or which will need the bootstrap panel and flexlayout css added to your theme to use, others will use bootstrap2 or other css to create the boxes.

In reply to Richard Oelmann

Re: display image for course

by abhishek bhattacharjee -

thanks richard for the reply 

i adapted all the renderers and lib files of your theme and even the layout includes which contains courseimage.php 

and you are 100% right that $output->main_content() does the same thing  ...what i want is to get the course pic and title to get it from database and just echo it in my custom front page with my custom css 

i have been struggling to do that since last 3 days with nothing still and its quiet important to complete my project within today i searched a lot but nobody has come up with any code or snippet that if you use will print the course image only you have helped me a lot still really sorry i coudn't work out .... whenever i search i get the snippet code what you have in the courseimage.php but i don't have the concept of the renderers properly so not able to figure out

thanks vwry much for the help

In reply to abhishek bhattacharjee

Re: display image for course

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

As I said, if you have the image in your html already - which it seems from what you are saying you do - then it should be a case of looking at the classes applied to that image and applying appropriate css to get it to appear and styled the way you want it.