I am using ctools modal. This is the first time ever using this.

I need a table cell to act as the link instead of a textual link. In addition, this cell is hard coded, not created by the render array. Because of the way this table is being created it cannot use the render array.

The table and cells are created dynamically, and each cell would link to the same location, just passing different variables.

Can anyone tell me how I can set these cells to act as links for my modal? If you have examples to point me to that would help as well.

Thanks,
CJ

Comments

nevets’s picture

How are you generating the current content of the cell? If it is not text, what is it?

cjobes’s picture

$img_schedule_modal_link = ctools_modal_text_button(t($day), 'admin/settings/ad_traffic/manager_modal/schedule_img/nojs/'.$atsid.'/'.$atbid.'/'.$day_data['day_start'].'/'.$day_data['day_end'].'/'.$bin_num, t('Click to schedule an ad image'), 'ctools-modal-ad-traffic-ad-image-scheduler');

return '<td title="Click to schedule an ad image" class="ad_traffic_cal_day_open">'.$img_schedule_modal_link.'</td>';
nevets’s picture

What is not working?

Are you including the appropriate files from ctools?

cjobes’s picture

I want the cell to be a link, not the text. As it is I am placing a textual link into a cell.

nevets’s picture

Two points

a) I don't think you can make the td element a link.

b) Even if you could, since the cell (td) contains a link, it would mean you have a link inside a link (which I suspect would work oddly.

If you already have a textual link in the cell, why are you trying to make the cell a link?

Jaypan’s picture

Just expand the size of the link to be the full size of the cell.

cjobes’s picture

The only reason there is a textual link in the cell is because that is all I know how to do at this time. Hence the question on how to make the cell the link.

There would not be a textual link in the cell if the cell itself were a link. Only text. Doing so would be redundant and completely unnecessary. The cell acting as a link is to allow the user to have a better interface experience and not have to click on the text.

Jaypan’s picture

So make the link the full size of the cell.

cjobes’s picture

Trying to do so.

.ad_traffic_cal_day_open a {
	display:block;
}

Problem is that it only fills left to right, not top and bottom.

nevets’s picture

What about adding height: 100%;