Jul 05, 2008, 11:10 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Read what MODx Developers say: MODx Dev. Blogs
Pages: 1 2 [3]   Go Down
  Print  
Author Topic: Support/Comments for CssSwitcher  (Read 11670 times)
0 Members and 1 Guest are viewing this topic.
coroico
Coding Team
*
Posts: 482


WWW
« Reply #30 on: Feb 10, 2008, 05:29 PM »

As I am currently being to set up a demo site for the ajaxSearch snippet, I have developped some "stuff switcher" (not sure that my english is correct) utilities classes and then as a first implementation, rebuilt the cssSwitcher snippet.
So find enclosed, based on the previous work of Guillaume, what could become the next 0.5 release of cssSwitcher.

This snippet is built under three re-usable classes :
- switcher class, to switch any string between two pages
- select class, to build a select drop down menu (with or without submit button)
- htmllist class, to build a html list (with or without background image)

This version add more flexible templating usages based on the chunckie class and a correction to the redeclare getchunck error of 0.4 version.

Read the cssSwitcher_readme.text file to understand the snippet installation and the different available parameters. Do not forget in the includes/snippet.cssSwitcher.inc.php file to initialise the CS_CSSPATH constant to your own css folder. And to describe the rigth css styles for the html tags.

In a second time, based on these 3 classes, I look to develop :
- a new version of l10n snippet, to change the language parameter as parameter of some others snippets
- a snippetSwitcher to change from the front-end the version of a snippet (could be useful for demo site)
- a docSwitcher to change the subset of documents as parameter of some others snippets like ditto or ajaxSearch

Thanks for your comments about this new cssSwitcher release and these "stuff switcher" classes
« Last Edit: Feb 11, 2008, 03:17 PM by coroico » Logged

              AjaxSearch 1.7.1                                                                                                   AnythingRating 1.0                                                                          CssSwitcher 0.5                       
Download           Documentation                                                                                    Download                         Documentation                                                                 Download
Demo site           Bugs & Features tracker     Support                                                      Demo site                       Bugs & Features tracker                                                      Support
coroico
Coding Team
*
Posts: 482


WWW
« Reply #31 on: Feb 11, 2008, 03:21 PM »

Find enclosed the 0.5 version of cssSwitcher. See the previous post and the cssSwitcher_readme.txt file for more informations. Thanks for your feedbacks.

The version 0.5 is now available in the repository
« Last Edit: Mar 25, 2008, 09:17 AM by coroico » Logged

              AjaxSearch 1.7.1                                                                                                   AnythingRating 1.0                                                                          CssSwitcher 0.5                       
Download           Documentation                                                                                    Download                         Documentation                                                                 Download
Demo site           Bugs & Features tracker     Support                                                      Demo site                       Bugs & Features tracker                                                      Support
goldeagle
Member
**
Posts: 62


« Reply #32 on: Feb 15, 2008, 09:24 PM »

Hi coroico,

This is good news for me as I am looking at making use of this. However you mention reading the readme file to understand the installation.

I may have missed something but it doesnt mention anything about how to install it, in regards to where things go. It merely outlines the parameters etc.

Perhaps you could make a post instructing people what goes where?

Regards,

Tom.
Logged
goldeagle
Member
**
Posts: 62


« Reply #33 on: Feb 15, 2008, 09:29 PM »

My apologies. Ive just clicked on. Thats tiredness for you lol....
Logged
goldeagle
Member
**
Posts: 62


« Reply #34 on: Feb 15, 2008, 09:57 PM »

Right, sorry dude.

But although I got it uploaded to the right place (I think Huh?) I simply cannot get it to work. I get the drop menu and it lists the style sheets correctly Smiley

But thats it. I can select which ever one I want and submit it and it simply will not work.
However if I then remove the &display=`1` from the snippet call the page will reload with the last CSS style I attempted to submit.

Logged
coroico
Coding Team
*
Posts: 482


WWW
« Reply #35 on: Feb 16, 2008, 10:10 AM »

Find enclosed an example of my template (ajaxSearch demo site in preparation):
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
Created By : Coroico (coroico@wangba.fr)
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=[(modx_charset)]" />
<title>[(site_name)] | [*pagetitle*]</title>
<meta name="keywords" content="" />
<link rel="stylesheet" type="text/css" href="assets/templates/ajaxSearchW/css/main.css" media="screen" />
[!CssSwitcher? &defaultcss=`relative`!]
<base href="[(site_url)]"/>
</head>
<body id="type-b">
  <div id="header">
    <div id="logo">
      <h1><a href="#">AjaxSearch</a></h1>
    </div>
    [!Wayfinder? &startId=`50` &level=`2` &outerTpl=`wfOuter`  &innerTpl=`wfInner` &rowTpl=`wfRow` &hereClass=`active` &firstClass=`first` &lastClass=`last` &titleOfLinks=`description`!]
  </div>
  <div id="content">
    <div id="colOne" class='boxed'>
        [!Wayfinder? &startId=`55` &level=`2` &hideSubMenus=`1` &outerTpl=`wfOuter2`  &innerTpl=`wfInner` &rowTpl=`wfRow` &parentRowTpl=`wfRow` &hereClass=`active` &firstClass=`first` &lastClass=`last` &titleOfLinks=`description`!]
        [!CssSwitcher? &parsefolder=`1` &language=`english-utf8` &display=`select` &defaultcss=`relative`!]
        [!DocSwitcher? &language=`english-utf8` &display=`select`!]
    </div>
    <div id="colTwo">
        [!Breadcrumbs? &crumbSeparator=`/` &pathThruUnPub=`1` &showHomeCrumb=`0` &showCrumbsAtHome=`1`!]
        [*content*]
    </div>
  </div>
<div id="footer">
  {{photochbFooter}}
</div>
</body>
</html>
You need a call
Code:
[!CssSwitcher? &defaultcss=`relative`!]
in the page header to load the default css file. And then in a document or somewhere in your template a call like:
Code:
[!CssSwitcher? &parsefolder=`1` &language=`english-utf8` &display=`select` &defaultcss=`relative`!]
In this example I use the select form (selection without button).
Be sure that the CS_CSSPATH constant in the includes/snippet.cssSwitcher.inc.php is defined for your needs.
In my exampe:
Code:
define('CS_CSSPATH','assets/templates/ajaxSearchW/css/search/');
The folder should contains your css files. for me it contains: relative.css and absolute.css, so I get a select form with two options.

Here docSwitcher is an another snippet used to define the document subset used by ajaxSearch. docSwitcher is based also on the three classes switcher, htmllist and select  And I use it in a document as follow:
Code:
[!AjaxSearch? &parents=`[[DocSwitcher]]` &language=`english-utf8`!]

Let me know if you have still some difficulties. I will write the wiki documentation once I know if a few number of people use this snippet.
« Last Edit: Feb 16, 2008, 10:15 AM by coroico » Logged

              AjaxSearch 1.7.1                                                                                                   AnythingRating 1.0                                                                          CssSwitcher 0.5                       
Download           Documentation                                                                                    Download                         Documentation                                                                 Download
Demo site           Bugs & Features tracker     Support                                                      Demo site                       Bugs & Features tracker                                                      Support
goldeagle
Member
**
Posts: 62


« Reply #36 on: Feb 16, 2008, 07:27 PM »

Yep, this has done the trick. Got it working. Now all I need to do is to find a way to style the text above the drop down menu.
Logged
coroico
Coding Team
*
Posts: 482


WWW
« Reply #37 on: Feb 17, 2008, 11:42 AM »

To style the text above the drop down menu, define the sytle csSpanClass

To understand edit the templates like templates/select.tpl.html. If you use display as "select" (drop down menu without button) then the template is:
Code:
<form id="[+cs.formId+]" action="[+cs.formAction+]" method="post">
  <label for="[+cs.labelFor+]">
    <span class="[+cs.spanClass+]">[+cs.spanText+]</span>
  </label>
  <select class="[+cs.selectClass+]" name="[+cs.selectName+]" onChange="[+cs.gotourl+]">
    [+cs.selectOptions+]
  </select>
</form>
By default [+cs.spanText+] is initialized with the value "csSpanClass".
If you want re-use an existing span style, adds in your snippet call &spanclass=`my_existing_style`

For the moment, without wiki documentation, to know, the default parameter values, edit the includes/snippet.cssSwitcher.inc.php file
Logged

              AjaxSearch 1.7.1                                                                                                   AnythingRating 1.0                                                                          CssSwitcher 0.5                       
Download           Documentation                                                                                    Download                         Documentation                                                                 Download
Demo site           Bugs & Features tracker     Support                                                      Demo site                       Bugs & Features tracker                                                      Support
goldeagle
Member
**
Posts: 62


« Reply #38 on: Feb 23, 2008, 06:43 PM »

Hmm, I cannot say I actually understood any of that Sad

I have looked all over for where to edit spanclass and I found that I cannot find the place in which you edit it???

All I actually want is for the text to appear as the same size as the paragraph text so i would simply need to assign id="p" to it, somehow...
Logged
coroico
Coding Team
*
Posts: 482


WWW
« Reply #39 on: Feb 24, 2008, 05:42 AM »

Quote
All I actually want is for the text to appear as the same size as the paragraph text
For that in your css file simply adds the csSpanClass style:
Code:
p, csSpanClass {  ... your p style definition ...}
or adds
Code:
csSpanClass {  ... your csSpanClass style definition ...}
Logged

              AjaxSearch 1.7.1                                                                                                   AnythingRating 1.0                                                                          CssSwitcher 0.5                       
Download           Documentation                                                                                    Download                         Documentation                                                                 Download
Demo site           Bugs & Features tracker     Support                                                      Demo site                       Bugs & Features tracker                                                      Support
goldeagle
Member
**
Posts: 62


« Reply #40 on: Feb 24, 2008, 07:00 AM »

Again I may have missed something here but I do not seem to be able to get this to function right.

Here is the part of the css file affected;
Code:
#left {
float: left;
width: 19%;
/* border-right: 1px solid #000000; */
margin-top: 5px;
}
#left h1 {
font-size: 14px;
text-align: center;
padding-left: 2%;
padding-top: 0px;
padding-bottom: 3px;
}
#left h2 {
font-size: 12px;
text-align: center;
padding-left: 2%;
padding-top: 0px;
padding-bottom: 3px;
}
#left p {
font-size: 10px;
padding: 5px;
}
#left p.csSpanClass {
font-size: 10px;
padding: 5px;
}
#left csSpanClass {
font-size: 10px;
padding: 5px;
}

Nothing seems to work and ive tried using the comma instead of the full stop as per your example above.
Logged
coroico
Coding Team
*
Posts: 482


WWW
« Reply #41 on: Feb 24, 2008, 08:00 AM »

The full style of the text before the select drop down menu is:
Code:
form #csFormId label span .csSpanClass
So, if as I understand left is a left part of your body, changes:
Code:
#left p {
font-size: 10px;
padding: 5px;
}
by
Code:
#left p, #left #csFormId .csSpanClass {
font-size: 10px;
padding: 5px;
}
Remove the other .csSpanClass style definition to avoid css conflicts.
Logged

              AjaxSearch 1.7.1                                                                                                   AnythingRating 1.0                                                                          CssSwitcher 0.5                       
Download           Documentation                                                                                    Download                         Documentation                                                                 Download
Demo site           Bugs & Features tracker     Support                                                      Demo site                       Bugs & Features tracker                                                      Support
goldeagle
Member
**
Posts: 62


« Reply #42 on: Feb 24, 2008, 08:48 AM »

Thats cracked it Smiley

Many thanks for that.

Now to tackle some of the other items im looking at and having problems with lol Smiley

Many thanks again,

Tom.
Logged
coroico
Coding Team
*
Posts: 482


WWW
« Reply #43 on: Mar 25, 2008, 09:22 AM »

The version 0.5 of CssSwitcher is now available in the repository
Logged

              AjaxSearch 1.7.1                                                                                                   AnythingRating 1.0                                                                          CssSwitcher 0.5                       
Download           Documentation                                                                                    Download                         Documentation                                                                 Download
Demo site           Bugs & Features tracker     Support                                                      Demo site                       Bugs & Features tracker                                                      Support
Pages: 1 2 [3]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!