thedigicraft / Atom.CMS

Atom.CMS
56 stars 52 forks source link

Dynamic Page with different layouts #166

Open extrarice opened 8 years ago

extrarice commented 8 years ago

Hi!

Thank you for making this tutorial!

I came across the tutorial video in youtube and i have been using your guides in making a new websites.

I have little to no knowledge at all about php but an expert with html and css.

Right now im having trouble with making a dynamic pages with different layout. I have a lot of questions to ask but its probably best if i ask it one by one.

Im currently at Developing a Dynamic Website 2014 - Part 10

My question. If i have different layouts for a page, say like different layout for homepage and different layout for innerpages. How should i go about in approaching this into making it a dynamic website? Because right now the example you are using has the same layout with home and innerpage.

Right now if i use "?page=1" it will load the index page. then if i use "?page=2" it will load the content of the innerpages but with the layout of the homepage. Hope it makes sense.

Thank You!

creptor commented 8 years ago

It doesn't make sense for me :3 but the PHP, or code per page type (as going to be explain in the next videos (kind of)) is just how the server process your data (or page layout), and not how the users reads it (browser). So to make the content dynamic you just have to adjust your CSS accordingly.

CSS teaches you, ...... things make no sense :P .

I'm not the creator of the videos by the way....

extrarice commented 8 years ago

Hi!

Maybe im just getting ahead of myself. i still havent finish the video yet but the question just came over me.

To further explain it. Say i have a website "test-website.com" with an index page and an innerpage with different layouts

In the table. i have 2 data. "ID 1" and "ID 2"

so in order to display the homepage. i would go to the address "test-website.com"

so for the innerpage, in order to display the correct layout for the inner i would go to the address "test-website.com/inner?page=2" Because if i would do "test-website.com/?page=2" it will display the content of ID 2 but it will use the layout of the homepage.

What i would like if possible is to remove the "inner" in "test-website.com/inner?page=2" just like in the example

EDIT: Ok guys im now confuse as to how im going to structure my website.

What im creating right now are a bunch of websites in one domain name

  1. So example. Main site is a landing page "www.main-website.com"
  2. In the "main-website.com" there are 5 images which will link to their respected sites but they are still under "main-website.com". So if i will click image1. It should redirect to "www.main-website.com/sub-site1" then this "sub-site1" has its own index and innerpages. Should create a new table for "sub-site1"?

Visually it will look something like this:

main-website css -> folder js -> folder images - folder index.html sub-site1 - folder
index.html
inner-page1.html
inner-page2.html

sub-site2 - folder | index.html inner-page1.html inner-page2.html

basically it looks just like that. Should i create a new table for each sub site?

Sorry if its really confusing

JasonMate commented 8 years ago

He sets up a views folder that lets you make any layout you need for any page you make. https://www.youtube.com/watch?v=oH1Rvr_UjIo

On Wed, Feb 24, 2016 at 12:39 AM, extrarice notifications@github.com wrote:

Hi!

Maybe im just getting ahead of myself. i still havent finish the video yet but the question just came over me.

To further explain it. Say i have a website "test-website.com" with an index page and an innerpage with different layouts

In the table. i have 2 data. "ID 1" and "ID 2"

so in order to display the homepage. i would go to the address " test-website.com"

so for the innerpage, in order to display the correct layout for the inner i would go to the address "test-website.com/inner?page=2" Because if i would do "test-website.com/?page=2" it will display the content of ID 2 but it will use the layout of the homepage.

— Reply to this email directly or view it on GitHub https://github.com/thedigicraft/Atom.CMS/issues/166#issuecomment-188126677 .

creptor commented 8 years ago

You're just overthinking the problem.... the thing is that YOU CAN ADD HTML TO THE PAGES that are fetch in a database.... you can easily add a div with a class or something to make look different.

If you're willing to create a page inside of a page (which I believe it's the inner thing you're talking) it should be handled like it. So i mean different table, pages, everything... or else your viewers will get confused at seeing your page has two layouts, with the same content (a new folder for this is essential or the .htaccess won't work). OR a different static page.... like a login page (login.php).

Also as @JasonMate said, you can change later the code for each page you make.

extrarice commented 8 years ago

Ok guys. I got it now. thanks for your inputs.

just a quick question.

Along the tutorial vids. does it show how to add a dynamic navigation with submenus?

creptor commented 8 years ago

I can't remember, but it's still really easy to implement :3