Welcome to Geeklog Tuesday, November 21 2017 @ 08:38 am EST


Status: offline

remy

Forum User
Full Member
Registered: 09/06/2003
Posts: 141
Location:Rotterdam & Bonn
the Common GeekLog Page Object (glCPO).

As a result of the discussion on the new glPage class, I see a need to make inventory of common (html) snippets which can be promoted to a glCPO. in the wiki you may find http://wiki.geeklog.net/index.php/Wireframes that gives a visual intro to wireframes. You'll get the concept.

In the manner laid out, any (hierarchical) structure can be documented in a wireframe using rectangles and so be defined as a glCPO. Some examples:

--a list with header + footer and detail lines
--a menu with main- and submenu's
--a pagination bar
--the login box
--a right- or left-block
--a common snippet like a link (COM_createLink) or a toolTip (COM_getToolTip)

What is interesting on the approach, is that any glCPO could be rendered either by a template, either by a JSON object, either by a javascript function. Take a list as the example. It has a header and footer, maybe a search form, and detail lines. Most of us use ADMIN_createList to render a list by handing over a mySQL result set. The list itself, including pagination, is rendered using a template but could be rendered thru a JSON object that is processed by a javascript on the page. There would be nothing to be changed in the logic of (plugin)code as far it is creating the correct glCPO to handle the desired rendering.

This topic is calling for candidates for a glCPO with a focus on snippets.
A snippet glCPO consists of a few html tags rendered in one or two lines. The snippet contains variables like a template.

PHP Formatted Code

COM_createLink: <a href={url} {attributes}>{content}</a>

PHP Formatted Code

COM_createImage: <img src={url} {attributes} title={hint} alt={hint} {xhtml}>

A more complex one:

PHP Formatted Code

COM_getTooltip:
hoverover: <img src={theme}/tooltips/images/tooltip.$_IMAGE_TYPE
            title={hint} alt={hint} id=glTooltipIcon {xhtml}>
template: classic.thtml({hoverover}, {class}, {text}, {title}, {link}, {cursor})
 

The important requirement is that in any case such a snippet can be embedded in a span or div tag without layout consequences. In other words it will adhere to the css box model. Don't worry about quotes in your examples.

All times are EST. The time is now 08:38 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content