Ok,
In order to recreate this in a working app on my end I need to understand the folder/file structure better.
I am assuming the following.
app name. dynamic_blog
modules
homepage
controllers
Homepage.php
view
grid-display.php
What is the module/path to public.php file?
Beer will definitely help,
Dan
4 years ago
#11
4 years ago
#12
Hi Dan,
I can copy the files into a G Drive and send link if you like. However, also see below.
app name = dynamic_blog
therefore = localhost/dynamic_blog
modules
homepage
controller: Homepage.php
views: grid-display.php and slider-display.php
welcome
contoller: Welcome.php ..calls the public template and passes in the data.
views: welcome.php ... all std content removed, file is empty.
Homepage.php has two key functions 1) creates the logic for the slider section for the homepage and passes into
slider-display.php
2) creates the logic for dsiplaying the blog posts on the homepage and passes into grid-display.php
Templates
Public.php is structured to call the partials and run the functions that create the slider and blog post grid.
Therefore public.php is structured as;
//partial to display header with menu
Template::partial('partials/header')
//call slider
Modules::run('homepage/_slider', $data)
//call blog posts
Modules::run('homepage/_get_all_posts', $data)
//TG helper
Template::display($data)
//call footer partial
Template::partial('partials/footer', $data)
I can copy the files into a G Drive and send link if you like. However, also see below.
app name = dynamic_blog
therefore = localhost/dynamic_blog
modules
homepage
controller: Homepage.php
views: grid-display.php and slider-display.php
welcome
contoller: Welcome.php ..calls the public template and passes in the data.
views: welcome.php ... all std content removed, file is empty.
Homepage.php has two key functions 1) creates the logic for the slider section for the homepage and passes into
slider-display.php
2) creates the logic for dsiplaying the blog posts on the homepage and passes into grid-display.php
Templates
Public.php is structured to call the partials and run the functions that create the slider and blog post grid.
Therefore public.php is structured as;
//partial to display header with menu
Template::partial('partials/header')
//call slider
Modules::run('homepage/_slider', $data)
//call blog posts
Modules::run('homepage/_get_all_posts', $data)
//TG helper
Template::display($data)
//call footer partial
Template::partial('partials/footer', $data)
4 years ago
#13
John that would be very helpful.
Save me time.
Dan
Save me time.
Dan
4 years ago
#14
Here you go
https://drive.google.com/drive/folders/1WcVc5BjVFSEU0vW7WZ2WgzWVcHUrKnjm?usp=sharing
https://drive.google.com/drive/folders/1WcVc5BjVFSEU0vW7WZ2WgzWVcHUrKnjm?usp=sharing
4 years ago
#15
If you're a member, you could also put them up on the forum John
https://ums.myds.me/phpbb/
https://ums.myds.me/phpbb/
4 years ago
#16
Ok John you can delete
e your g drive post.
Simon is right. Did not think of posting to
Speed Coding Academy
Dan
e your g drive post.
Simon is right. Did not think of posting to
Speed Coding Academy
Dan
4 years ago
#17
Firstly, nice blog John :)
I think you're trying to be a bit too fancy with templates and coming in from the root is confusing the framework
I haven't done much with Pagination, but will try to learn it with you.
I can see 'pagination_root' is important and leaving it as an empty string is causing the double '//'
by adding 'welcome/index' it kind of works, but then the URL get mucked up - will have to look into it a bit closer
I think you're trying to be a bit too fancy with templates and coming in from the root is confusing the framework
I haven't done much with Pagination, but will try to learn it with you.
I can see 'pagination_root' is important and leaving it as an empty string is causing the double '//'
by adding 'welcome/index' it kind of works, but then the URL get mucked up - will have to look into it a bit closer
4 years ago
#18
Thanks I appreciate the comment,
and I agree, I am confusing the framework.
It occurred to me that this actually would not be way you would go in production as even if we got the pagination working, it would mean the page reloading the images at the top as well.
I therefore have tried to use Ajax, but I could not get this to work as quite frankly I am probably not good enough ;-)
Therefore, I think the answer for now is to only add four posts to the homepage, with a 'read more' link to a blog posts page which loads them all and where I will be able to paginate as it will use the standard module/method link to the page.
I really appreciate you putting the time on this !!
Cheers
and I agree, I am confusing the framework.
It occurred to me that this actually would not be way you would go in production as even if we got the pagination working, it would mean the page reloading the images at the top as well.
I therefore have tried to use Ajax, but I could not get this to work as quite frankly I am probably not good enough ;-)
Therefore, I think the answer for now is to only add four posts to the homepage, with a 'read more' link to a blog posts page which loads them all and where I will be able to paginate as it will use the standard module/method link to the page.
I really appreciate you putting the time on this !!
Cheers
4 years ago
#19
Thanks, I have just enabled my account, Now what is the next step to use Trongate to build a pornsite?