Results 1 to 6 of 6

Thread: How can I define and use generalized html?

  1. #1
    Join Date
    Mar 2016
    Location
    Southeastern NY State
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How can I define and use generalized html?

    Hello, I've given up attempting to figure out how to do something in HTML. Perhaps, someone here can "solve" this problem. My skill-level is semi-ancient programmer.

    I need to publish a meetings schedule comprising 7 days, where each day has a list of locations, with information, and many of the locations will be in multiple days. The user selects a day and the locations-list is displayed for that day.

    Location X may appear in 5 distinct lists. My programmer's mind tells me that I want to put the location-data for X (and any) location in one place and reference that information when I display the location-list for the subject day.

    The html that displays X's location-data should be in one place but I can't quite figure out how to define and reference the generalized HTML.

    I know I can do this with Javascript, but I am NOT going to do this with Javascript or PhP or anything other that HTML because of compatibility issues. I've been using CSS with good results (no use of "nth-child") but I can't figure out how to display ("imbed") the generalized location html (defined in one place). I've tried to store it in a file but I couldn't figure out how to "bring in" (insert) the html and get that to work. I know that <object> won't work. I couldn't get <iframe> to work.

    I will appreciate any help at all.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I think the only way you could do something like that within the limitations you're imposing would be with css. Even that could have problems due to compatibility. PHP actually has no compatibility issues as far as browsers go. The only issue with PHP is whether or not the server the page is on has PHP and the permissions your PHP code requires enabled. For something like what you're talking about, the permissions required should be minimal.

    Back to css, you can actually do a lot using the :hover, :focus and/or :active pseudo classes of links and other elements. And there are also CSS 3 tricks for modern browsers. But I would be hesitant to go that way (any css only system) due to the possible unpredictable manner in which they might behave on touch devices and/or under older browsers. For an example of some of what can be done there though, see:

    http://www.dynamicdrive.com/style/cs...sh_down_panel/

    and:

    http://www.dynamicdrive.com/style/cs...image_gallery/

    Or any of the many other ideas that might suit you presented in the DD CSS Library:

    http://www.dynamicdrive.com/style/

    Finally I would say javascript is probably more reliable and universal, though no method is entirely. Well simply having all information laid out and visible at all times would be.
    Last edited by jscheuer1; 03-04-2016 at 02:11 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2016
    Location
    Southeastern NY State
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your reply.

    I know that I could accomplish what I want with javascript but the first thing I learned was that the user's browser might not support javascript or it might be disabled. I learned what was required for php and rejected that. I thought if I could do it with HTML, then all would be fine, but I'm trying to share data between pages--I think that's the way to describe what I want done (I went to your down_panel link.).

    I thought it would be so simple if I could just fetch the location-data (html) from an .html file and that would be the single, generalized solution. I guess I think this because I don't know how the browser works "under the covers".

    The other option would be, what...SQL? I remember that on mainframes! lol. I bet that's not an easy solution.

    I'm going to go through the information at your /style link and look through the CSS library.

    Thanks!!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Depending upon just what you are wanting to do, and with the possible exception of iframe, object tags, and/or framesets* (I'd suggest googling each of those three to find out what each can do - one or more of them might just be the solution for you), there's nothing but javascript or something server side (PHP, asp, SQL**) that will allow you to share info among various files/pages. That said, one can simply navigate from page to page and in that give the illusion of fetching different pages. That's simple. You only need several or more almost identical looking pages, by linking to another similar looking page with the other info on it, it can appear as though you are fetching the info into the current page.

    You are probably right about the limitations of javascript and/or PHP. But, since you're unfamiliar with using each of them, you probably see their limitations as more serious than they really are. Millions, probably more, sites make use of one or both. The truth is you will not be leaving that many users behind if you use javascript, and you will not be leaving any users behind if you use PHP.


    *With iframe and framesets, you can have ordinary HTML links (a tags) on a page that will target a section of that page and when clicked, bring in another page to that targeted frame (section or place on that page). Object may be able to do the same, at the very least it allows other content (video, audio, text, other pages, etc.) to appear on the page when the page first loads.

    **To use a database live online, you also need something like PHP or asp to bridge the gap between the mainframe (server) database and the presentational (HTML) side.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jan 2015
    Posts
    78
    Thanks
    0
    Thanked 19 Times in 19 Posts

    Default

    I need to publish _________.
    Fill in the blank with whatever type of 'content' you are publishing.

    1) You can manually create each page with the content you want, using a programming editor. This is how things were done back in the 1990's, before server-side includes and server-side languages were developed. This has the disadvantage of taking a lot of time to create and maintain and is error prone since any changes made to the content or navigation must be made in all the places information is used at or linked to. This results in a lot of broken links, inconstant page content, and inconstant page layout.

    2) Same as method #1, but use server-side-includes (SSI - https://en.wikipedia.org/wiki/Server_Side_Includes ) or php (or any other server-side language) statements to read and place common content on the pages. This has most of the same disadvantages of method #1, since it doesn't use the capabilities of a server-side language to get the computer (a tool) to do the work for you of dynamically producing content and navigation. This only separates out common content.

    An advantage of using any server-side method is it reduces the number of http requests required to produce a web page and is therefore faster and uses less resources (each http request has communication overhead and process overhead on the web server) than client-side include methods.

    3) Use iframe or client side includes (javascript around the content) in the client. This has the same disadvantages of the above methods. You are still manually creating and maintaining code for all the pages. This only separates out common content. There are some additional disadvantages with using javascript - it must be enabled for the page to display the content at all and you must create external javascript files with some minor javascript code around the content. Doing this on the client-side increases the number of http requests required to produce the web page and is measurably slower than dong this server-side. Each http request will be in the order of 100's of milliseconds per file (though if they are cached in the browser, each different file is only read once - javascript, I don't know if this is the case for iframes). SSI or php statements will be in the order of 100's of microseconds per file.

    4) Use a server-side language, such as php, to implement a data driven content management system (CMS.) There are existing CMS scripts, from simple to feature-bloated, for you to either use or just examine to see how others have implemented this. Once you have a CMS set up, all you would be tasked to do is enter and maintain the data making up the schedule. All the pages, navigation, links, ... would be dynamically produced using that data.

  6. #6
    Join Date
    Mar 2016
    Location
    Southeastern NY State
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the help.

    I solved the problem by changing the design so that the information is presented in a chart with location/info in column 1, and Sun.-Sat. in 7 columns as 2 through 8.

    This is RESOLVED.

    Thanks again!

Similar Threads

  1. how can i define the checkvalue on?
    By megha_3000 in forum HTML
    Replies: 2
    Last Post: 02-04-2012, 09:07 AM
  2. Replies: 13
    Last Post: 08-09-2008, 06:28 PM
  3. Replies: 32
    Last Post: 07-03-2007, 09:34 AM
  4. Define <h1> tag
    By geoffb in forum CSS
    Replies: 5
    Last Post: 12-30-2006, 02:51 PM
  5. define
    By merlyn in forum JavaScript
    Replies: 2
    Last Post: 01-10-2005, 06:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •