Показать сообщение отдельно
Старый 03.11.2010, 18:46   #1
Илья
Senior Member
 
Регистрация: 15.02.2006
Адрес: Петербург
Сообщений: 462
По умолчанию Сделать ссылку на элемент контента?

Как можно сделать ссылку на элемент контента, а не на целую страницу?
Пробую взять пример из экста rgmoodalbox
здесь в примере все работает нормально: пример да и без лайтбокса тоже вот
Код:
Get a single content element

To get a single content element inside a lightbox you just need a bit of TS Code. Create somewhere a page and add this TS

# TS CODE

# get tt_content elements

temp.record = COA

temp.record {

10 = RECORDS

10 {

tables = tt_content

source.data = GPvar:ce

if.isTrue.data = GPvar:ce

dontCheckPid = 1

}

}

# get news reocrds

temp.record2 = COA

temp.record2 {

10 = RECORDS

10 {

tables = tt_news

source.data = GPvar:news

if.isTrue.data = GPvar:news

dontCheckPid = 1

}

}

# load it into the page-Object

page.10 >

page.10 < temp.record

page.20 < temp.record2

All what you now have to do is call a url like this for content elements:

index.php?id=174&ce=55&no_cache=1

and this url for tt_news records:

index.php?id=174&news=25&no_cache=1

174 is the ID of the page where you saved the TS Code.

Modify links on the fly
Насколько я понял, в примере на страницу с ID 174 пихают этот TS код, и потом при вызове изменяют только ce=55 (идентификатор контент элемента)
Убрал в коде новости получил:
Код:
# TS CODE
# get tt_content elements
temp.record = COA
temp.record {
  10 = RECORDS
  10 {
    tables = tt_content
    source.data = GPvar:ce
    if.isTrue.data = GPvar:ce
    dontCheckPid = 1
  }
}
page.10 >
page.10 < temp.record
Но при вызове вижу не контент элемент отдельно, а целиком страницу, где он расположен.
Илья вне форума   Ответить с цитированием