Jump to content

Domain Form.


Michael

Recommended Posts

I'm not sure if I'm the only one but I think the domains are a bit cramped on the order form. So I was wondering it maybe you could make them have a set number per row.

 

At the moment I've managed to do this with CSS but it's still not the best.

 

Old:

 

domains-old.PNG

 

New:

 

domains-new.PNG

 

CSS Change if you wish to use this temp way:

 

ul.domain_check label {
margin-right: 10px !important;
margin-top: 10px !important;
}
ul.domain_check input[type="checkbox"]{
margin-left: 7px !important;
margin-top: 10px !important;
}

I put mine in the layout.css file in app/views/client/css/

Link to comment
Share on other sites

Create a new class ;)

.domainrow { display:inline-block; width: 50px; height: 14px; }
<span or div class="domainrow">[ ] .com </span or /div>

 

 

Please put here the file html

I wish it was that easy mate haha this is the code for it:

 

/plugins/order/views/templates/standard/types/domain/lookup.pdt

<li>
<?php
	foreach ($tlds as $tld => $pack) {
	$this->Form->fieldCheckbox("tlds[]", $tld, in_array($tld, $this->Html->ifSet($vars->tlds, array())), array('id' => "t" . $tld));
	$this->Form->label($tld, "t" . $tld, array('class' => "inline"));
	}
?>
</li>
Link to comment
Share on other sites

Ehehehehe

Try 

 

.domainrow { display:inline-block; width: 50px; height: 14px; }

 

<li>

<?php
foreach ($tlds as $tld => $pack) {
 ?>

<div class="domainrow">
<?php
$this->Form->fieldCheckbox("tlds[]", $tld, in_array($tld, $this->Html->ifSet($vars->tlds, array())), array('id' => "t" . $tld));
$this->Form->label($tld, "t" . $tld, array('class' => "inline"));
 ?>  

</div>
<?php
}
?>
                                    
</li>
Link to comment
Share on other sites

Ehehehehe

Try 

 

.domainrow { display:inline-block; width: 50px; height: 14px; }

 

<li>

<?php
foreach ($tlds as $tld => $pack) {
 ?>

<div class="domainrow">
<?php
$this->Form->fieldCheckbox("tlds[]", $tld, in_array($tld, $this->Html->ifSet($vars->tlds, array())), array('id' => "t" . $tld));
$this->Form->label($tld, "t" . $tld, array('class' => "inline"));
 ?>  

</div>
<?php
}
?>
                                    
</li>

Thanks for trying mate but yours did this:

 

domains-test.PNG

 

I think we need a way to limit the query to 9 per row.

Link to comment
Share on other sites


.domainrow { display:inline-block; width: 80px; height: 16px; border: 1px solid #eeeeee; align: left; padding: 3px; float: left; margin: 2px; }

.domainrow:hover { display:inline-block; width: 80px; height: 16px; border: 1px solid #dddddd; align: left; padding: 3px; float: left; margin: 2px; background: #eeeeee; }

Link to comment
Share on other sites

I'm not sure if I'm the only one but I think the domains are a bit cramped on the order form. So I was wondering it maybe you could make them have a set number per row.

 

At the moment I've managed to do this with CSS but it's still not the best.

 

 

CSS Change if you wish to use this temp way:

 

ul.domain_check label {
margin-right: 10px !important;
margin-top: 10px !important;
}
ul.domain_check input[type="checkbox"]{
margin-left: 7px !important;
margin-top: 10px !important;
}

I put mine in the layout.css file in app/views/client/css/

 

How about you remove that CSS, and use this instead:

 

<li class="tlds">
    <?php
    $i = 0;
    $tlds_per_row = 9; // some integer in the range [1..9]
    $tld_count = count($tlds);
    
    foreach ($tlds as $tld => $pack) {
        if ($i%$tlds_per_row == 0) {
    ?>
    <div class="tld-row">
    <?php
        }
    ?>
        <span class="tld">
            <?php
            $this->Form->fieldCheckbox("tlds[]", $tld, in_array($tld, $this->Html->ifSet($vars->tlds, array())), array('id' => "t" . $tld));
            $this->Form->label($tld, "t" . $tld, array('class' => "inline"));
            ?>
        </span>
    <?php
        if (($i%$tlds_per_row) == ($tlds_per_row-1) || ($i+1 == $tld_count)) {
    ?>
    </div>
    <?php
        }
        $i++;
    }
    unset($i, $tlds_per_row);
    ?>
</li>

 

CSS:

.tlds { text-align:left;}
    .tlds .tld-row { clear:left;}
        .tlds .tld-row .tld { float:left; display:inline-block; width:100px;}
Link to comment
Share on other sites

How about you remove that CSS, and use this instead:

 

<li class="tlds">
    <?php
    $i = 0;
    $tlds_per_row = 9; // some integer in the range [1..9]
    $tld_count = count($tlds);
    
    foreach ($tlds as $tld => $pack) {
        if ($i%$tlds_per_row == 0) {
    ?>
    <div class="tld-row">
    <?php
        }
    ?>
        <span class="tld">
            <?php
            $this->Form->fieldCheckbox("tlds[]", $tld, in_array($tld, $this->Html->ifSet($vars->tlds, array())), array('id' => "t" . $tld));
            $this->Form->label($tld, "t" . $tld, array('class' => "inline"));
            ?>
        </span>
    <?php
        if (($i%$tlds_per_row) == ($tlds_per_row-1) || ($i+1 == $tld_count)) {
    ?>
    </div>
    <?php
        }
        $i++;
    }
    unset($i, $tlds_per_row);
    ?>
</li>

 

CSS:

.tlds { text-align:left;}
    .tlds .tld-row { clear:left;}
        .tlds .tld-row .tld { float:left; display:inline-block; width:100px;}

 

Thanks mate that's perfect I added margin-left: 20px; to the .tlds to make it more center than to the left. Is there any chance they could come like that by default?

 

http://billing.cubicwebs.com/plugin/order/main/preconfig/domains

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...