Welcome to TalkGraphics.com
Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Join Date
    Dec 2006
    Location
    Melfort, Saskatchewan Canada
    Posts
    1,013

    Default Code inseration into placeholder from menu code generator

    Further to some messages to Acorn and Egg I'm using https://www.cssportal.com/css3-menu-generator/ Egg has supplied a terrific video and Acorn has helped considerably.

    I'm missing something.

    CSS code goes into the website > head and the opening and closing <style> tags

    HTML goes into the placeholder body.

    Javascript code goes into the website body with the opening and closing <script>

    JS placeholder requires the <script> opening and closing.

    Questions - is the JS code placed within the HTML body? or can it be added below the HTML.

    I realize this is elementary coding, but on preview I've got a blank page with a paragraph of coding on top.

    Thx
    Bill
    Bill Wood
    Charity Web Design
    XARA Pro+. WD17, Designer 17. Premium packages.

  2. #2
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,826

    Default Re: Code inseration into placeholder from menu code generator

    Quote Originally Posted by bwood View Post
    Further to some messages to Acorn and Egg I'm using https://www.cssportal.com/css3-menu-generator/ Egg has supplied a terrific video and Acorn has helped considerably.

    I'm missing something.

    CSS code goes into the website > head and the opening and closing <style> tags
    HTML goes into the placeholder body.
    Javascript code goes into the website body with the opening and closing <script>
    JS placeholder requires the <script> opening and closing.
    Questions - is the JS code placed within the HTML body? or can it be added below the HTML.
    I realize this is elementary coding, but on preview I've got a blank page with a paragraph of coding on top.
    Thx Bill
    Bill, there is no JS Placeholder.
    Whatever you are doing is not terminating the code or have fluffed its syntax in one of the input areas.

    Have you checked out my example file?
    It has a Placeholder with HTML <nav></nav> Tags in both Main and Variant.
    In Website Head, you'll find the <style></style> Tags.
    In Website Body are the <script></script> Tags.
    I would carefully check all your quotes to see if you copied across some handed ones.

    If you placed the menu detail in a layer that layer has to be visible of have a ! prefix if closed.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  3. #3
    Join Date
    Dec 2006
    Location
    Melfort, Saskatchewan Canada
    Posts
    1,013

    Default Re: Code inseration into placeholder from menu code generator

    Okay I think I may have this. - in @acorns example if you add code thru the web properties > website tab > body and head, one can see the code

    Now if you go to website properties > placeholder - one can see the code for the head - but no the body.

    I believe that is my confusion.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	acorn menu.jpg 
Views:	36 
Size:	93.0 KB 
ID:	134574  
    Attached Files Attached Files
    Bill Wood
    Charity Web Design
    XARA Pro+. WD17, Designer 17. Premium packages.

  4. #4
    Join Date
    Dec 2006
    Location
    Melfort, Saskatchewan Canada
    Posts
    1,013

    Default Re: Code inseration into placeholder from menu code generator

    Quote Originally Posted by Acorn View Post
    Bill, there is no JS Placeholder.
    Whatever you are doing is not terminating the code or have fluffed its syntax in one of the input areas.

    Have you checked out my example file?
    It has a Placeholder with HTML <nav></nav> Tags in both Main and Variant.
    In Website Head, you'll find the <style></style> Tags.
    In Website Body are the <script></script> Tags.
    I would carefully check all your quotes to see if you copied across some handed ones.

    If you placed the menu detail in a layer that layer has to be visible of have a ! prefix if closed.

    Acorn
    I think I realize my confusion., but I'm not quite there. In web properties there is a placeholder tab > head and body boxes where you can place code.

    Also in web properties there is a website tab > which also contains Head and Body boxes where you can place code.

    In your example, when I open the widget I see a simple HTML code box, not head or body. then I click advanced to see where you put the code.

    That my confusion. If one uses the placeholder tab only -- the html goes in the body, javascript goes into the body, and the CSS goes into the head. My confusion is more the difference between the placeholder > body and head and the website > body and head. Ive include 4 pics - the first two are the placeholder boxes -- and the last pics are the website tab and body and head.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	1 -placeholder body.jpg 
Views:	43 
Size:	97.4 KB 
ID:	134576   Click image for larger version. 

Name:	2 placeholder head - no code.jpg 
Views:	37 
Size:	89.1 KB 
ID:	134577  

    Click image for larger version. 

Name:	3 website body.jpg 
Views:	37 
Size:	118.9 KB 
ID:	134578   Click image for larger version. 

Name:	4 website tab - head - styles.jpg 
Views:	36 
Size:	93.7 KB 
ID:	134579  

    Bill Wood
    Charity Web Design
    XARA Pro+. WD17, Designer 17. Premium packages.

  5. #5
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,826

    Default Re: Code inseration into placeholder from menu code generator

    Website Head - anything here is added to the bottom of the <head> section for every page.
    Website Body - anything here is added to the bottom of the <body> section for every page.
    Page Head - anything here is added to the bottom of the <head> section for that page.
    Page Body - anything here is added to the bottom of the <body> section for that page.
    Placeholder Head - anything here is added to the bottom of the <head> section for that page.
    Placeholder Body - anything here is added in situ at the Placeholder's position for that page.

    Visible HTML usually has to therefore go into a Placeholder. Anywhere else and you have no control on where it is positioned.
    CSS usually goes into the Website or Page Head as the styling can be applied as the DOM is rendered. Some Xara set-ups may require CSS to be in the Body.
    JavaScript should always be called after the DOM is fully loaded so putting it in the Website or Page Body ensures that.
    Code into a Placeholder will work but you need to work out its position so that it is applied after the DOM elements affected have actually been created.

    Xara has recently confused the quick access to code which is usually fine for third party widgets but it is always safest to go via Web Properties.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  6. #6
    Join Date
    Dec 2006
    Location
    Melfort, Saskatchewan Canada
    Posts
    1,013

    Default Re: Code inseration into placeholder from menu code generator

    Excellent. Thank you for the clarification. i think I should be able to handle this now. I noticed on one of eggs videos there were two placeholders and one contained a script or a style sheet. Thanks again.

    -Bill
    Bill Wood
    Charity Web Design
    XARA Pro+. WD17, Designer 17. Premium packages.

  7. #7
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,826

    Default Re: Code inseration into placeholder from menu code generator

    Quote Originally Posted by bwood View Post
    Excellent. Thank you for the clarification. i think I should be able to handle this now. I noticed on one of eggs videos there were two placeholders and one contained a script or a style sheet. Thanks again. -Bill
    Bill, you should now be able to see that Egg's placeholder use is page-specific. It provides a handy widget to drag and drop across designs.
    If it was used over 10 pages, that's 10 Placeholders you have to track Better then to use the code inserted into the Website.

    A better overall approach is to make the code modules external assets and link into them through statements in all or any of the above. Harder to explain but great to easily modify without having to republish an entire site.

    It does get squirrely as JS, CSS and HTML all have different approaches to 'includes' or embedding.

    Say, you think you are going to change the NavBar labelling and Links then you could add the HTML and save as navigate.html and bring in as an external asset.
    You would use a Placeholder sized similarly to your current set up for the NavBar but replace all the HYML with:
    <iframe src="index_html_files/navigate.html" onload="this.before((this.contentDocument.body||th is.contentDocument).children[0]);this.remove()"></iframe>

    Thereafter all you do is make changes to navigate.html and save. A browser refresh and you have a new NavBar.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  8. #8
    Join Date
    Dec 2006
    Location
    Melfort, Saskatchewan Canada
    Posts
    1,013

    Default Re: Code inseration into placeholder from menu code generator

    Copied and noted. One more question. lets say you've got all your pages built. And your using the CSS nav bar generator - https://www.cssportal.com/css3-menu-generator/ > design. In the menu url - is the full address of the page necessary? - conversely one could place code in the nav bar code.

    I'll be brushing up on my style sheets. I know my html, but a little rusty on CSS.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	menu url.jpg 
Views:	37 
Size:	98.3 KB 
ID:	134582  
    Bill Wood
    Charity Web Design
    XARA Pro+. WD17, Designer 17. Premium packages.

  9. #9
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,826

    Default Re: Code inseration into placeholder from menu code generator

    Quote Originally Posted by bwood View Post
    Copied and noted. One more question. lets say you've got all your pages built. And your using the CSS nav bar generator - https://www.cssportal.com/css3-menu-generator/ > design. In the menu url - is the full address of the page necessary? - conversely one could place code in the nav bar code.

    I'll be brushing up on my style sheets. I know my html, but a little rusty on CSS.
    Bill, no you do not need to use fully qualified URLs. Use relative URLs. Jump to Contact Us page would just be contacts.htm(l).

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  10. #10
    Join Date
    Dec 2006
    Location
    Melfort, Saskatchewan Canada
    Posts
    1,013

    Default Re: Code inseration into placeholder from menu code generator

    Yahoo! Made a menu Acorn and @Egg- following your instructions. Just had to know where to place everything.

    Now - for a mobile menu variant. One could go with one button with pages nested below it. It works well but the big HOME button for the drop down pages is going to look pretty gamely.

    I did think of @chris M for a pop up, but theres quite a few pages. I could use that for a 4 or 5 pager. Is there a way to work that hamburger symbol in there.
    Bill Wood
    Charity Web Design
    XARA Pro+. WD17, Designer 17. Premium packages.

 

 

Tags for this Thread

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
  •