Error
  • EasyCalcCheck Plus: Wrong version! Version for Joomla! 2.5 installed. Please uninstall and install correct version!
Welcome, Guest
Username Password: Remember me

Identifying module div
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: Identifying module div

Identifying module div 1 year, 10 months ago #205

  • fAdEd247
Hi,

I'm trying to identify the div containing the date & time span. When I go into mod_date2.php, and apply
if($align != "0"){
		echo "<div id="timediv" style=\"margin:0px auto;width:auto;text-align:".$alignment.";\">";
	}


I get a fatal error on my front end.

Ultimately, I'm trying to accomplish positioning this module beneath my search bar or header logo.

I also applied " datediv" and "DateDiv" to the module class suffix, however this suffix doesn't display via firebug.

When I address the span ID ty2udate51, I'm unable to apply margin-top or bottom. I think this is because of the div.

Thanks for the help.

Ty
Last Edit: 1 year, 10 months ago by .

Re: Identifying module div 1 year, 10 months ago #206

  • ryan
  • OFFLINE
  • Administrator
  • Posts: 175
  • Karma: 8
It looks like you aren't escaping the quotes you have added to your div id which could be the reason you are getting a fatal error. Just put \"timediv\" and it may work.

To allow a span tag to be modified you have to add display:block; to its css if that helps you any.

I am almost finished working on the next version of this module which will have a lot of improvements and a couple new features so if you have any suggestions just let me know and I will add them in. Otherwise I will probably release it today or tomorrow if I get it done.
Joomla template developer, Joomla enthusiast, Linux user, programmer, artist

Re:Identifying module div 1 year, 10 months ago #207

  • fAdEd247
Hi,

Thanks for the reply.

I've applied div id=\"timediv\". I do not receive any errors(a good sign ) however the div does not display within firebug, just the span ty2udate51.

Applying display block to the span allows me to move the span. Thanks for that suggestion

It seems that div the ty2u span is in( div pathway which should be timediv) is cutting of the display of the ty2u span when margin-top is set to negative.

Please see: www.infinitesolutionsonline.com

I applied:
#ty2udate51 {
display:block;
margin-top:-1%;
}

The module seems to work very well at this time, I'm interested in seeing what surprises you have in store this time!

Sorry, I have no suggestions for editions. I pride myself on thinking of new enhancements, and I can't think of one this time!.. A good sign!

-Edit - I noticed that the time is wrong on my module. When going to module parameters, I corrected this by setting the time zone offset. I'd prefer to choose central standard time, pacific standard time, etc. Know what I mean?

Thanks.

Ty
Last Edit: 1 year, 10 months ago by . Reason: Just noticed something

Re:Identifying module div 1 year, 10 months ago #208

  • ryan
  • OFFLINE
  • Administrator
  • Posts: 175
  • Karma: 8
Hey there,

I don't see any timediv anywhere in your source code. If you are editing the module's source code to add a surrounding div element you can do that easier inside the module parameters by adding a pre text and post text. For example adding <div class="timediv"> to pre text and </div> to post text params will wrap the span tag in the div. Notice I use class for timediv instead of id incase you happen to have mutliple instances of the module. id is usually so Javascript can reference the object and only one instance of each id can by on the page or it fails validation. You can however have as many instances of a class name as you want.

I believe having a negative value for a margin or padding is not necessarily w3c compliant either but perhaps for certain doc types it is. I haven't really looked into it much but I know sometimes during validation it mentions a negative margin being invalid.

A trick instead is to add some CSS to the wrapper element (.timediv) as position:relative; and the inner element (#ty2udate51) as position:absolute; then you can move it up or down within the wrapper element by adding top:-10px; or top:10px; If you take of position:relative from the wrapper element it will position relative to the page instead of the wrapper element.

The id on the span for #ty2udate51 has a number on the end because it is the module id # and will change with each instance of the module you create. This should allow for multiple instances of the module on the page. Something I haven't actually tested yet in this newest version I am making. I keep finding new things I want to add. I am just in the final stages. I have only a couple more TODO items on the list.

However, the #ty2udate51 also is necessary for Javascript to reference the object so it can insert the time and date into that object. I chose a span tag because by default they will appear on the same line as other text and shrink to the width of its contents. A div tag on the other hand will by default expand to maximum width and appear on its own line. I believe both can be modified to match each other though by using CSS.

Some of my source code params where it uses 0 and 1 for the value are a bit confusing because some use 0 for yes and 1 for no. There was a certain line somewhere that had to be like that so I just changed the values on the params. I don't even remember exactly where that is but I think it had something to do with the Javascript.

Some of the new features I am adding are:
-The option to use the logged in users timezone that they have configured on their profile.
-The ability to set a separate time zone for PHP and Javascript.
-PHP will be always used and will act as a fallback if they happen to have Javascript disabled.
-the option to compress the javascript output - and I compressed the actual javascript file as well
-the ability for Javascript to automatically detect DST since some areas don't use it

I was trying to find a way to make PHP optionally use the visitors time instead of the servers time but the only proper way to do that is use some Javascript. I could make it an option though anyway.

I also restructured all the code and made the module params a bit nicer to use. Joomla 1.6 will be even better.
Joomla template developer, Joomla enthusiast, Linux user, programmer, artist

Re:Identifying module div 1 year, 10 months ago #209

  • ryan
  • OFFLINE
  • Administrator
  • Posts: 175
  • Karma: 8
Oh almost forgot to mention, you have a jquery conflict on your page.

I posted this fix on my other site (which I was going to use just for storing useful bits of info like this for myself but don't really use it as much as I should) www.ryanrhode.com/node/7
Joomla template developer, Joomla enthusiast, Linux user, programmer, artist

Re:Identifying module div 1 year, 10 months ago #210

  • ryan
  • OFFLINE
  • Administrator
  • Posts: 175
  • Karma: 8
I actually also added the ability to choose the time zone from a list of time zones =)
Joomla template developer, Joomla enthusiast, Linux user, programmer, artist
  • Page:
  • 1
  • 2
Time to create page: 0.18 seconds

Live Chat Offline

Blogging with Joomla just got easier...
Try EasyBlog for Joomla! Click the link above to buy EasyBlog Pro for Joomla. Enter your information to pay, then download it and install. There are a bunch of extra modules you can install for it too. There are plenty of options for customization and integration and themes to match your site. They will even help you if you get stuck and install it for you. There are more versions of EasyBlog available here.
Read my review of EasyBlog