From 1b53318d83dad49d618f639d972d716937b2280c Mon Sep 17 00:00:00 2001 From: Raghav <raghavsmart1213@gmail.com> Date: Mon, 24 Feb 2025 05:59:00 +0000 Subject: [PATCH] Intro card separated to calltoaction.php --- _templates/calltoaction.php | 12 ++++++++++++ index.php | 14 ++------------ libs/load.php | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 _templates/calltoaction.php diff --git a/_templates/calltoaction.php b/_templates/calltoaction.php new file mode 100644 index 0000000..ba6056a --- /dev/null +++ b/_templates/calltoaction.php @@ -0,0 +1,12 @@ +<section class="py-5 text-center container"> + <div class="row py-lg-5"> + <div class="col-lg-6 col-md-8 mx-auto"> + <h1 class="fw-light">Album example</h1> + <p class="lead text-body-secondary">Something short and leading about the collection below—its contents, the creator, etc. Make it short and sweet, but not too short so folks don’t simply skip over it entirely.</p> + <p> + <a href="#" class="btn btn-primary my-2">Main call to action</a> + <a href="#" class="btn btn-secondary my-2">Secondary action</a> + </p> + </div> + </div> + </section> \ No newline at end of file diff --git a/index.php b/index.php index a422c04..ac31815 100644 --- a/index.php +++ b/index.php @@ -182,18 +182,8 @@ include 'libs/load.php'; <main> - <section class="py-5 text-center container"> - <div class="row py-lg-5"> - <div class="col-lg-6 col-md-8 mx-auto"> - <h1 class="fw-light">Album example</h1> - <p class="lead text-body-secondary">Something short and leading about the collection below—its contents, the creator, etc. Make it short and sweet, but not too short so folks don’t simply skip over it entirely.</p> - <p> - <a href="#" class="btn btn-primary my-2">Main call to action</a> - <a href="#" class="btn btn-secondary my-2">Secondary action</a> - </p> - </div> - </div> - </section> +<!-- To load Welcome card (calltoaction.php) from template folder --> +<?load_template('calltoaction');?> <div class="album py-5 bg-body-tertiary"> <div class="container"> diff --git a/libs/load.php b/libs/load.php index db63d70..a77ad0d 100644 --- a/libs/load.php +++ b/libs/load.php @@ -1,6 +1,6 @@ <?php function load_template($name){ - print("including ". __DIR__."../_templates/$name.php"); + include __DIR__. "/../_templates/$name.php"; } ?> \ No newline at end of file -- GitLab