0

カスタム Joomla コンポーネントでページネーションを設定しています。ページの長い説明を避けるために、複雑な iframe の埋め込みとフォワード マスキングを行っています。これは、コンポーネントのフロント エンドのページネーションです。

私のiframeには、(カスタムコンポーネントからの)子犬のリストがあります。ページ分けされています。子犬が iframe に正しく表示されるためには、次の URL が必要です。

http://americasfavoritepuppybreeders.com/puppies/breed/labrador/page-2.html?tmpl=component&view=マイクロサイト

ただし、実際にページ 2 のページネーション リンクをクリックすると、view=microsite が削除され、問題が発生します。ビュー=マイクロサイトをドロップしないようにこれを調整するにはどうすればよいですか?

元の URL はhttp://americasfavoritepuppybreeders.com/puppies/breed/labrador/page-1.html?tmpl=component&view=micrositeです。

このページネーションのコードは長く、モデル、ビュー、view.html.php の間にあるため、関連するすべてのコードを投稿するのは難しいようです。ここに私が探していた場所があります。

どこで/どのようにこれを行うかについてのアイデアやヒントはありますか?

ありがとうザック

// Get the pagination request variables
    $limit      = $app->input->get('limit', $params->get('display_num', 20), 'uint');
    $limitstart = $app->input->get('limitstart', 0, 'uint');

    $this->setState('puppies.limit', $limit);
    $this->setState('puppies.limitstart', $limitstart);

    // Load the parameters.
    $this->setState('params', $params);
    }           

/** Method to get a store id based on the model configuration state. **/
protected function getStoreId($id = '')
    {
    // Compile the store id.
    $id .= ':' . $this->getState('puppies.breed_alias');
    $id .= ':' . $this->getState('puppies.limit');
    $id .= ':' . $this->getState('puppies.limitstart');
    $id .= ':' . serialize($this->getState('puppies.filter'));
    $id .= ':' . $this->getState('puppies.featured');

    return parent::getStoreId($id);
    }

/** Method to get a JPagination object for the data set. **/
public function getPagination()
    {
    // Create the pagination object.
    $limit = (int) $this->getState('puppies.limit');
    $page = new JPagination($this->getTotal(), $this->getStart(), $limit);

    return $page;
    }

/** Method to get the total number of items for the data set. **/
public function getTotal()
    {
    return $this->items_total;
    }

/** Method to get the starting number of items for the data set. **/
public function getStart()
    {
    $start = $this->getState('puppies.limitstart');
    $limit = $this->getState('puppies.limit');
    $total = $this->getTotal();
    if ($start > $total - $limit)
        {
        $start = max(0, (int) (ceil($total / $limit) - 1) * $limit);
        }

    return $start;
    }

繰り返しますが、ここにコードの一部がありますが、これに対する回答のために投稿を開始する方法がわからないので、コードを投稿しますが、正しい方向に向けてください、ありがとう.

4

2 に答える 2

1

Somewhere at the bottom of your "adminform" in that view, there should be the all the hidden inputs that submit the view / controller / token.

Something like this:

            <input type="hidden" name="option" value="com_puppies" />
            <input type="hidden" name="view" value="microsite" />
            <input type="hidden" name="task" value="" />
            <input type="hidden" name="boxchecked" value="0" />
            <inupt type="hidden" name="controller" value="microsite" />
            <input type="hidden" name="filter_order" value="<?php echo $this->escape($this->state->get('list.ordering')); ?>" />
            <input type="hidden" name="filter_order_Dir" value="<?php echo $this->escape($this->state->get('list.direction')) ?>" />
            <?php echo JHtml::_('form.token'); ?>

Feel free to remove the inputs you won't use (i.e the filter_order ones if you handle that differently). The vital one is the view input. Also, leave the controller input out if you are not using a controller for that view (meaning you are using the default controller for that component)

于 2013-03-04T00:14:26.057 に答える
0

このリンクhttp://americasfavoritepuppybreeders.com/puppies/breed/labrador/page-1.html?tmpl=component&view=micrositeを SEF なしで提供できますか? そのようなコードでファイル /templates/{$your_template}/html/pagination.php を作成してみることができます

<?php
function pagination_item_active(&$item){
    $getData = new JInput($_GET);
    $view = $getData->get('view','','string');
    $link_part = ($view == 'microsite' ? '&view=microsite' : '');
    $link = "<a title=\"" . $item->text . "\" href=\"" . $item->link.$link_part  . "\" class=\"pagenav2\">" . $item->text . "</a>";
    return $link;
}

function pagination_item_inactive(&$item){
    return "<span class=\"pagenav\">" . $item->text . "</span>";
}

また、間違ったリンクに問題があると思います。このリンクhttp://americasfavoritepuppybreeders.com/puppies/breed/labrador/page-1.html?tmpl=component&view=micrositeをどのように入手しましたか? view=microsite で準備完了リンクを使用する場合は、管理パネルのビュー (マイクロサイト) にリンクを作成して、このリンクを使用してみてください。

于 2013-03-04T07:57:20.560 に答える