GithubHelp home page GithubHelp logo

Comments (14)

upsonp avatar upsonp commented on August 20, 2024

I've setup a personal development sites specifically for working with the PHP Variant and demos on a MS IIS server at work and an Apache server on my home laptop and have started working on fixing issues with the existing theme-gcwu-fegc php variant demos.

I've split the demos-php directory into two directories.

  1. "demos-php" which includes the not required demos and
  2. "dist-php" directory which includes all of the required files for using the variant.

I've added $_UNKNOWN['gcwu_php_dist_folder'] as a new variable to the /dist-php/theme-gcwu-fegc/inc/config.php file to define the location of the required php variant files.

I've opted to use the $_UNKNOWN['gcwu_theme_folder'], $_UNKNOWN['gcwu_dist_folder'], and $_UNKNOWN['gcwu_php_dist_folder'] variables set in the /dist-php/theme-gcwu-fegc/inc/config.php file to control paths throughout the variant, I'm certain this will be compatible with anything done in core wet v4.0 and will make referencing various variant and core files consistent and easy to update in one location.

Using the path variables described above makes It easy for me to merge the directories back together if that's what the other PHP variant users would prefer, but I'd really like to keep what's required to use the variant separate from the working demos.

Once I'm finished making the updates to the theme-gcwu-fegc demos I'll check them into a fork for scrutiny. If acceptable, I'll start work on the base theme and intranet them demos.

from wet-boew-php.

nschonni avatar nschonni commented on August 20, 2024

I'm thinking gcwu_php_dist_folder should actually be wb_dist_folder since it holds all the assets for all themes and not just GCWU. Alternately wb_assets_folder.

from wet-boew-php.

upsonp avatar upsonp commented on August 20, 2024

@nschonni I agree, really the /dist-php/theme-gcwu-fegc/inc/config.php file should reside outside of the theme specific folder. Perhaps it should be merged with the /dist-php/inc/config.php file. Further investigation is required, but I think it has a lot of information that's common to all themes, the only theme specific variable is the gcwu_theme_folder variable.

I'll get through the theme-gcwu-fegc demo updates first, but the issue you raise will be important and we should discuss it further.

from wet-boew-php.

nschonni avatar nschonni commented on August 20, 2024

If the "assets" folder is defined, then the theme folder can be build like: gcwu_theme_folder = wb_assets_folder + "/theme-gcwu-fegc". Sorry if the syntax is off, I haven't touched much PHP.

from wet-boew-php.

upsonp avatar upsonp commented on August 20, 2024

I've run into a bit of a snag. I've gotten most of the PHP Variant theme-gcwu-fegc demos working, but am stuck on the Multilingual Splash page demos.

/demos-php/theme-gcwu-fegc/sp-pe-mult-theme-gcwu-fegc-eng-fra.php
/demos-php/theme-gcwu-fegc/sp-pe-mult-theme-gcwu-fegc-fra-eng.php
/demos-php/theme-gcwu-fegc/sp-pe-theme-gcwu-fegc-eng-fra.php
/demos-php/theme-gcwu-fegc/sp-pe-theme-gcwu-fegc-fra-eng.php

The previous author uses the $_NAVPATH variable instead of the $_PAGE variable as in the rest of the variant, then there's an include '/dist-php/inc/sp-pe-vars.php' where if say the $_NAVPATH['lang2'] is set it's copied to $_PAGE['lang2']. I'm wondering if anyone can tell me if there is a reason behind this?

My first instinct is to get rid of the sp-pe-vars.php include and just rename all $_NAVPATH variables to $_PAGE to be consistent with the rest of the variant, but I'm hesitant to do so in case there's good reason for the way it is.

from wet-boew-php.

pjackson28 avatar pjackson28 commented on August 20, 2024

@jeffdavidgordon @MaddyDaigle Could you please answer the question from @upsonp?

from wet-boew-php.

upsonp avatar upsonp commented on August 20, 2024

Once I got going on this I discovered a lot from the wet v3.1 core was missing from the variant and ran into some major issues with the code being difficult to read. I've basically rewritten the variant and have it sitting in an "experimental" branch in my fork. All of the theme-gcwu-fegc demos work. If I was into work tomorrow I'd drop it into my development site to see if it breaks anything in a real world test, but I guess that'll have to wait until Monday.

I've renamed a number of files and tried to organize them to make future updates easier. I'm hoping the modifications won't be a major issue.

Paths are set in the /inc/config.php file. This greatly enhances deploying the variant and make future updates much easier.

I've made a number of changes to the variable names $_UNKNOWN, $_NAVPATH and $_TEMPLATE are all now just $_SITE. After much inspection it seems the three names were just created at different times, but served the same purpose. The $SITE variables are set in the /inc/config.php and /theme-gcwu-fegc/config.php files. $_PAGE is the same as before. I've added a couple of $_PAGE variables to handle server and splash pages.

The variant now has one "main-template", attached below, users can use the same layout for every page regardless of weather it's a server, splash, application or content page. The $_PAGE variables at the top of the template determine the type and content is added between the begin and end main content comments, pretty much the same as before.

The $_PAGE['isapp'], $_PAGE['issplash'] and $_PAGE['isserv'] variables can be set to display a page as an application, splash page or server page. Not setting any of these will default to the standard content.

Setting the $_PAGE['left_menu_gauche_eng'] or $_PAGE['left_menu_gauche_fra'] variable will automatically default the page to a two column layout with a left side menu. This makes the $_PAGE['is_left_gauche'] == "1" obsolete.

So now I'm in kind of a now what spot? I started updating some of the documentation, but I don't want to get too heavily into that until I know if my updates to the variant are going to be acceptable or if it's just too different and needs to be redone without the serious update.

<?php
//this is the only time the user needs to hard code the path, once the
//configuration file has been required all other paths can use the variables from that
//file. 
require_once $_SERVER['DOCUMENT_ROOT'] . "/dist-php/inc/config.php";

/* These are the required variables fore each page */
//set 'lang1' to 'eng' for English pages, 'fra' for French pages
$_PAGE['lang1'] = "";
$_PAGE['title_' . $_PAGE['lang1']] = "";
$_PAGE['issued'] = "YYYY-MM-DD";
$_PAGE['modified'] = "YYYY-MM-DD";

/* This is a list of optional variables 

// Set the short title for the page to be displayed just above the main content
// if not set then the required $_PAGE['title_' . $_PAGE['lang1']] above will be used
$_PAGE['short_title_' . $_PAGE['lang1']] = "";

// Set the alternate short title for the page to be displayed just above the main content
$_PAGE['short_title_' . $_PAGE['lang2']] = "";

// Set 'isapp' to one to use the application template. If this is an application use
// the 'version' variable, which is displayed at the bottom of the content area
// instead of the Date Modified
$_PAGE['isapp'] = "1";
$_PAGE['version'] = "";

//set 'issplash' to one to use the splash page
$_PAGE['issplash'] = "1";

//set 'isserv' to one to use the server template
$_PAGE['isserv'] = "1";

*
 *  Pointing 'left_gauche_menu_eng' or 'left_gauche_menu_fra' to a
 *  file will use that file as the left side menu (secondary navigation)
 *  and make this page a two column layout automaticlly. 
 *
$_PAGE['left_gauche_menu_eng'] = $_SERVER['DOCUMENT_ROOT'] . "/demos-php/menu-left-gauche/secnav1-eng.php";

//Possible options for languages
$_PAGE['lang1'] = "eng";
$_PAGE['lang2'] = "fra";
$_PAGE['lang3'] = "deu";
$_PAGE['lang4'] = "spa";
$_PAGE['lang5'] = "ita";
$_PAGE['lang6'] = "por";
$_PAGE['lang7'] = "rus";

****************************************/

//includes the doc type and metadata that can be set based on the required variables set above
include_once $_SERVER['DOCUMENT_ROOT'] . $_SITE['wb_php_dist_folder'] . "/inc/head-doc.php"; 
?>

<!-- custom page metadata start -->
<meta name="description" content="English description / Description en anglais" />
<meta name="dcterms.creator" content="English name of the content author / Nom en anglais de l'auteur du contenu" />
<meta name="dcterms.subject" title="scheme" content="English subject terms / Termes de sujet en anglais" />
<!-- end of custom metadata -->

<?php
//Sets the common and theme specific CSS
include_once $_SERVER['DOCUMENT_ROOT'] . $_SITE['wb_php_dist_folder'] . "/inc/head-css.php"; 
?>
<!-- CustomCSSStart -->

<!-- CustomCSSEnd -->
<?php 
//Adds the header navigation elements (Images, buttons, Titles) based on they type of this page isapp, issplash, isserv
include_once $_SERVER['DOCUMENT_ROOT'] . $_SITE['wb_php_dist_folder'] . "/inc/head-nav.php";
?>
<!-- Main content start -->
<?php 
    /*******************************************************************/
    /*Page Content can go here or be included here from a separate file*/ 
    /*******************************************************************/
?>
<!-- MainContentEnd -->
<?php
//includes the date modified, leftside menu if provided, footer menus and standard and theme specific javascript
include $_SERVER['DOCUMENT_ROOT'] . $_SITE['wb_php_dist_folder'] . "/inc/foot-nav.php"; 
?>
<!-- CustomScriptsStart -->
<!-- CustomScriptsEnd -->
<?php 
//closes the pages body and html tags
include $_SERVER['DOCUMENT_ROOT'] . $_SITE['wb_php_dist_folder'] . "/inc/foot-end.php"; 
?>

from wet-boew-php.

pjackson28 avatar pjackson28 commented on August 20, 2024

@upsonp The changes are good as long as you give instructions for how to migrate from the old version to the new version. Would be good to accompany those instructions with relevant diffs like was done with the v3.1.0 release notes to help people to better understand the changes. I'd also recommend providing the above items in some form of release notes and to include a brief explanation as to why you made the changes you did.

from wet-boew-php.

upsonp avatar upsonp commented on August 20, 2024

@pjackson28 thanks a yay or nay was all I was waiting for. Hopefully I will have some time later today to start some docs. The migration doc might be tricky since there was no formal ''How to setup'' documentation to begin with. When I did it I took one of the examples then rewrote a bunch of it to make it work on my site. Then used that as the template for the rest of my site; there was a lot of experimenting. I'd like to hear from other users to see how they used the variant to help me write the migration doc.

There will be oodles of developer documentation, I'm going to have a lot of trouble sleeping until I get everything outta my head

from wet-boew-php.

upsonp avatar upsonp commented on August 20, 2024

I've added the theme-gcwu-fegc PHP demos to my password protected preview site. I haven't done the content multi-lingual and fixed mobile header examples yet, but plan to at some point this week.

I've also been working on the theme-base and theme-wet-boew demos at home, but they aren't ready yet. When I'm done with them I'll put them up.

The PHP Demos can live here for awhile. Is there a place where the PHP variant demos can go more permanently?

http://www2.mar.dfo-mpo.gc.ca:8080/wet-boew/demos-php/
Username: WEBSITEREVIEW
Password: T-9)N2z

This is a site where I typically put pages that are in transition between development and public so users outside of DFO can view and provide input on content. Feel free to poke around the BIO portion to see real world examples of how I've implemented some things in the PHP variant, but note that not everything on that side of the site works 100% of the time and changes frequently.

from wet-boew-php.

nschonni avatar nschonni commented on August 20, 2024

The PHP Demos can live here for awhile. Is there a place where the PHP variant demos can go more permanently?

We haven't finalized the location, but the discussion is ongoing here #20

from wet-boew-php.

upsonp avatar upsonp commented on August 20, 2024

Base Theme working examples are working and posted to the password protected preview site noted above

from wet-boew-php.

upsonp avatar upsonp commented on August 20, 2024

@pjackson28 cc @jeffdavidgordon @nschonni

I now have theme-wet-boew, theme-gcwu-fegc and theme-base working. I can easily add new themes and demos in a couple hours and I feel confident that the restructuring and updates in the upsonp/wet-boew-php fork can rein this variant back in for a PHP Variant 3.1 release, but this ended up being a huge rewrite of basically everything to simplify creating new themes and configuring a site to make future updates of the variant easier to incorporate. I've tested this variant quite heavily the BIO Development and Preview sites, as well as my home server and am confident enough in it that I released it to the public BIO site. (www.bio.gc.ca)

I've done a bit of documentation on the PHP Variant wiki page documentation some of the major points of interest in the variant and plan to start adding a "How to add a theme", "How to setup a site from scratch" and "How to migrate from PHP Variant 3.0" over the next couple of days. I'd like to submit a pull request and have a code review before getting to heavily into the "How to's". Nothing sucks more that writing ten pages of documents and having to rewrite the whole thing from scratch when someone points out an unnoticed bug/issue.

from wet-boew-php.

upsonp avatar upsonp commented on August 20, 2024

All working examples have been revamped in the master PHP Variant

from wet-boew-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.