Best way to extend the the calendar with codeigniter? - codeigniter

I'm searching for an easy way to extend the codeigniter calendar in the following way:
I have a start and an end date. The days between are coherent. For example: I want to change the background color of the cells from 11.11.2011 to 15.11.2011 (start date and end date came from the database). In the cell with the start date I want add an additional background image (this works fine at this time). How did I have to extend the template?
Best regards ...

By ammending the template you send across to the Calendar Class - http://codeigniter.com/user_guide/libraries/calendar.html - you can use the {cal_cell_content_today}{/cal_cell_content_today} tags to find out if there is an event for that particular day and then do as you wish. Maybe add a class or inline styles. Whatever works better for you.
The only drawback I've had with this is that you have to pass the days individually. So for your example, you'd need to send the following dates:
11.11.2011
12.11.2011
13.11.2011
14.11.2011
15.11.2011

Related

Adding labels to explorations data in GA4?

Is it possible to add an arbitrary label to a GA4 exploration?
For example I am tracking outbound link clicks for phone numbers. I would like to add a short description to each number.
I was thinking something like if Link URL equals 'tel: xx xxxx xxx' a label would say 'city office'. Any ideas on this?
Well... You have GTM tag added to your question. This implies that you're ok having a GTM solution.
Well, in GTM, find the tag that fires on the phone clicks, add a custom event property to the tag that would contain the description of the numbers, make a custom JS (CJS) or a look up table (LUT) or better a regex LUT, and map your numbers to descriptions.
Then go to GA and register that event property as a custom dimension. Done.
You could also override the link url dimension in GTM with a CJS var that would generate descriptions in the same dimension, but it's not a good idea to override default dimensions unless you're confident about what you're doing.
GA4 has capabs to modify event properties, but it's extremely basic and won't be able to change properties based on their values. Also, it's a bad idea to have data modification logic in GA. It's best to contain all data modification logic in one place whenever you can help it.

Simile Timeline change order of lines

How do I change the vertical order of event lines in Simile Timeline? Where in the code does it decide what order to put them in?
I have tried looking into this also. I am convinced it is random order.
This not the answer you wanted but try using this timeline
http://almende.github.io/chap-links-library/timeline.html
It is quite flexible, you can choose your create your own layout and use your own CSS/HTML in each individual event.
Edit: Found a attribute that you could use to change the order
trackNum - used to override the automatic layout of events on the
Timeline.
check this wiki for more info: http://simile-widgets.org/wiki/Timeline_EventSources
under "Event Attributes for Developers"

Am I misusing Ruby on Rails Layouts

EDIT:
Okay, so using cells I have got it running, indeed the rb file created by the cells scripted needed:
helper ApplicationHelper
this got past the error in the comments below, but now inside my application helper, i have a method:
def hr_user_past
#current_year = current_year
#hr_user_past ||= Employee.where("username=? and year < ?", session[:hr_user].username, #current_year).order("Year DESC") if session[:hr_user]
#past_times = #current_year - 2011
#blart = 'test'
end
And alas, this now cannot find current_year which is a def method in my application_controller.rb, so I think my flow is all messed up and not sure what I need to have where for a good solid "include".
Def of the current_year from application controller
class ApplicationController < Actioncontroller::Base
helper_method :current_year
...
...
def current_year
OpenPeriod.maximum :year
end
end
I also am worried all this work still wont solve the issue I am having with the twitter bootstrap modal dialog being called from a layout and not fadeing in all the way with data (minute i put the same code in a view, it works right)... but one issue at a time i guess...
END EDIT
Trying to have an objective question here though. Some background:
I have a navigation layout that has this nice login, home button and a few others on it. It works fine, lately the customer wanted some more functionality added to this namely a smart button that drops down dynamically with data filled out (stuff from years past from old forms we use).
So the app used a twitter bootstrap modal elsewhere. I just posted this question here:
twitter bootstrap modal does not work in rails3 layout?
Where I am having an issue with this modal working correctly from the layout. Then I got to thinking, this modal that drops down has some good amount of data usually from a specific controller, but they want to see this data at any moment. Is the layout way of doing this not the way, should I build an application helper .rb code to fill out a partial and include that partial on every page in the app? ( seeems like it should fix my modal displaying oddly, like constantly faded issue). I think my green-ness to ruby on rails is at fault here. I know its awesome and there is a lot to it and this is the first project I have done in it. So I am not sure what the correct solution is here, and I think its a vocabulary issue. Like what am i looking for?
Form helpers
Templates
Partials
etc etc... what is the best fit here? I realize in coding there is a lot of ways to skin a cat but I am not sure where to ask. Rereading this is getting subjective. Basically
I have a home controller that sets up things on a home page, turns out this data needs to be seen by the user at any given moment from any page in the app. Tried to move it to our navigation layout, its not going well. Is this the right approach or is there a better one?
One approach would be to use Cells. Essentially, a cell is a miniature controller that takes care of fetching data and rendering a view. It's not quite a full-blown view, it's a component which, similar to a partial, may be included into other views of your application - or even the layout, which is useful when you have something that appears on every page.
A classic example (which they implement on their homepage) is that of a shopping cart - it appears throughout your app but it needs to have some data set; turning it into a cell extracts both the querying and the rendering into a nicely-separated MVC unit.

Saving wysiwyg Editor content with Ajax

I am writing a cms (on .net) and have structured the whole page to work client side.
There is a treeview that lets you add/remove/move items and define their names in the languages defined. For each language I save the names of the category defined, but when there is HTML content associated with it, i fall into the JavaScript serializer problem that finds the content too long to be serialized.
What would be the best approach to make sth like this work. Shall I change everything to work with postbacks, or try to manually call _doPostBack for the editor content (which I don't want). Thank you in advance.
I guess would be great to make auto-save with time interval which will submit only diffs between current state and previous save. It will do the key if the user will edit it manually, not for copy/paste, of course. It is if we talk about really big data that we need to save.
Otherwise need to find some ways to compress the data before submitting: json+base64, etc.

Ajax driven timeline-style blog (in Drupal)

I have created a blog in drupal using CCK and taxonomy.
I wish to display my posts in a timeline, according to the posted date (using views).
So far I have created a listing of the post titles on a timeline.
I now want to display the posts using ajax, wherein clicking on a post title will load the content of that node on the same page. Going ahead I'll add each fetched node into a ul tag and thus create a carousel kind of display of all fetched posts so far.
Whats the best way of achieving this, considering that I have enough knowledge to create a custom module.
Here's where I got my idea from.
http://www.jvm-neckar.de
Try the aptly named http://drupal.org/project/timeline project. I used it long time ago... its a nifty module and you can visualize your various posts on a scrollable timeline. Posts that are frequent will be together and posts that are apart (in time) will be apart -- its all scaled accurately. It has integration with views, of course.
I'm not sure about whether it will meet your exact requirements. Check out an example here:
http://simile.mit.edu/timeline/examples/jfk/jfk.html

Resources